Hi there, this may be a beginner's error, but I've been unable to find a solution on my own and by googling, and now I am really stuck on it.
I am simply trying to move directories called for example CAT_Run01.ica to a directory with the corresponding number, Run01, in the same directory.
For some reason the loop does not work
nrun=`ls -d CAT_Run??.ica | wc -l`
for run in `seq 1 $nrun`; do
mv CAT_Run0$run.ica Run0$run
done
The "mv" command works manually: if I instead of looping type "run=1", then the line "mv CAT_Run0$run.ica Run0$run" will work and move "CAT_Run01.ica/" to "Run01/". The sequence works, it prints out the correct numbers.
But for some reason, when running the loop, I get the error:
"-bash: 0.ica: command not found"
Best,
Andreas
Psychology student just trying to work with some data