I am trying to rename all files in a directory using mv
but it isn't working. My code is:
id= '29 10 15'
for zzvar in ${id} ; do
mv /media/storage/DTI/vgcross_sj${var}* /media/storage/DTI/vgcross_SJ${var}*
done
Even when I take the loop out and just try the command with one subject, I get the error:
mv: target:/media/storage/DTI/vgcross_SJ is not a directory.
Obviously it's not a directory, because that's what I'm trying to rename the file as! Do you have any ideas as to why it's not working?
id= '29 10 15'
shouldn't have space after = sign, within script you're referencing ${var}, while your loop uses zzvar – Sergiy Kolodyazhnyy Jul 17 '17 at 14:25Thank you!
– jbenady Jul 18 '17 at 10:59