Good day! I have the following script which is supposed to rename and then send files in a folder on my Mac to an FTP server.
for f in "$@"
do
mv "$f" "${f%.mpeg}.mpg"
curl -T "$f" ftp://1.2.3.4/Vol123456-01/MPEG/ --user me:secret
mv "$f" "/Users/me/Sent Stuff"
done
That works fine except for that first mv line. The script successfully renames the file, but then the following commands seem to no longer be able to find "$f". I am pretty new to bash scripting. Is there a way to refresh perhaps what "$f" means so that the curl and mv lines know what it is? Thanks in advance!