The script pasted below causes the following error:
cat: can’t open ‘/tmp/drive/P0.RAW’: No such file or directory
It looks like the script does not properly evaluate $N for the filename.
How $N be made to evaluate so the file name is something like P01L.RAW, P02L.RAW, etc.?
N=1
until [ $N -ge 10 ]; do
cat bmpheader.bmp /tmp/drive/P0$NL.RAW > ./P0$NL.bmp
./quality_metric_test ./P0$NL.bmp
N=$((N + 1))
done
Your problem is that bash interprets all uppercase characters as part of the variable by default, so it’s looking for
$NLinstead of just$N. This is why it returns justP0.RAW, as$NLis an unexisting variable. You can easily avoid that by a minor syntax adjustment, call the variable with curly brackets ({and}) around it. Replace this:With this:
That should do the trick.