I would like to get a sequence of numbers like this 01,02, .., 30 But if I use {01..30}, I will get 1,2, ... 30, zero before the single-digit number is missing. How can I get the format, for example, 01,02..30? thanks in advance
In Bash4, your brace extension {01..30}actually works the way you want it. If you are on Bash3 or lower, you can use the built-in printfalong with the brace extension to get what you want without resorting to external commands.
{01..30}
printf
$ printf "%02d " {1..20} 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
seq -w 1 30 # ought to work
how in:
for number in $(seq -w 1 30); do touch /tmp/bleah$number.dat done
Source: https://habr.com/ru/post/1776813/More articles:Javascript clock synchronization with server clock - javascriptWhy is this Albacore task defined in the class not working? - ruby | fooobar.comManaging an ASP.NET user control with a user control generates a null reference - inheritancehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1776811/amazon-sqs-to-funnel-database-writes&usg=ALkJrhjZlP8CpvjrDhFPGknzVM3GPZx6TwKeyboard using FOREVER to pop up iPhone application while debugging - debuggingIs there a way to find out if an event handler was fired with code in jQuery without custom flags? - jqueryjavah cannot find android classes - androidVariable Size Message in MPI - parallel-processingHow to save class reference in Java? - javaHow can I host HTML5 in my .NET application? - html5All Articles