santanudas
Technical User
hi guys,
Need to write a bash script which will increment the numbers by 1 but the number should be with leading zero, i.e. 01, 02, 03 etc.
So, if I do
#!/bin/bash
s=`seq -w 5 12`
for i in $s
do
echo $[i+1]
done
not returning the desired result. I tried replacing “$[i+1]” with “$[s+1]” and that doesn't work too. What wrong am I doing? Any guys out here to help?
Thanks in advance.
Need to write a bash script which will increment the numbers by 1 but the number should be with leading zero, i.e. 01, 02, 03 etc.
So, if I do
#!/bin/bash
s=`seq -w 5 12`
for i in $s
do
echo $[i+1]
done
not returning the desired result. I tried replacing “$[i+1]” with “$[s+1]” and that doesn't work too. What wrong am I doing? Any guys out here to help?
Thanks in advance.