Need help with simple script (Renaming files with csv)
I have a folder of jpgs I need to rename and a .csv that has the old and new names listed in it. I'm trying to use this script:
while IFS=';' read -r old_name new_name _; do
printf 'Renaming "%s" to "%s"\n' "$old_name" "$new_name"
mv "$old_name" "$new_name"
done < list.csv
But I haven't been able to get it to work... All that happens is this:
UFO:pics john$ while IFS=';' read -r old_name new_name _; do
set -x
printf 'Renaming "%s" to "%s"\n' "$old_name" "$new_name"
mv "$old_name" "$new_name"
done < list.csv
IFS=';'
read -r old_name new_name _
++ update_terminal_cwd
++ local 'SEARCH= '
++ local REPLACE=%20
++ local PWD_URL=file://UFO.local/Users/john/desktop/pics
++ printf '\e]7;%s\a' file://UFO.local/Users/john/desktop/pics
UFO:pics john$
Any help greatly appreciated!!!