0

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?

David Foerster
  • 36,890
  • 56
  • 97
  • 151

0 Answers0