I’m trying to create a shell script that shall convert certain Files according to some rules. The files are organized like this:
file_0000.adat
file_0001.adat
file_0002.adat
file_0003.adat
...
file_0010.adat
file_0011.adat
...
file_9999.adat
My current script looks like this:
#!/bin/sh
lauf=$(expr 0)
for filename in ../distData/file_*.adat
do
...
lauf=$(expr $lauf + 1)
done;
But now I only want the files with numbers from 0000 to 1500. For the conversion I need the number of the file (done by the variable lauf in the script). Can’t figure out how to do this right now.
Thanks for replys.
Try something like: