Quote:
Originally Posted by grail
Well you would need to use printf to get the leading 0 to appear in output.
However, if the question is how to cycle through your files with the for loop:
Code:
for x in u*.asc
do
do_your_stuff_here
done
|
I could't quite done what I really need to do. If you can help me....
I need to remove text in the file(First 5 lines) for each existing file and save as same name.
The name of files are in order of date and hour. e.g) u0101.asc, u0102.asc... u0110.asc ..u0212.asc...u3123.asc...
So, I used 'tail' command ( I need last 94 lines)
for ((date=01; date<=31; date++))
for ((hour=00; hour<=23; hour++))
do
tail -94 directory/u${date}${hour}.asc > directory/u${date}${hour}.asc
done
But the variables ${date}and${hour} are recognized as one digit '1' instead of '01'.
Please help me to solve this case.