I would like to change the format of an integer type number adding zeros to the left of it in a script in bash. For example
number=1
echo $number
00001
Thanks
I would like to change the format of an integer type number adding zeros to the left of it in a script in bash. For example
number=1
echo $number
00001
Thanks
man printf.
thanks:
printf "%06d\n"
can it be done with echo as well?
nope you can't do it with echo