I'm brand new to bash scripting and wrote (with some help) a script this afternoon which I used to move some of my flatmates AVIs (on CD) to my hard drive.
I have now moved all of them and won't be needing the script anymore, however, it struck me that I might use a very similar script again, only slightly modified.
What my script does at the moment is just grab ALL the files from one location and copy them to another. I would like to modify it slightly so that there is an option to ask the user what files he would like to move.
Here is my current script. It is very simple and self explanitory. Feel free to run it if you want, just remember to change the source directory and the target directory.
HERE IS THE SCRIPT
#Currently, it copys from /mnt/cdrom to /mnt/trek/TNG_Season1
echo "Please enter CD into drive."
#TODO: MOUNT FAILED. EJECT CD BAY. "PLEASE INSERT CD."
echo "I am now mounting the CD drive."
echo "CD drive mounted successfully."
echo "Are you ready to copy the tracks to the hard drive? (y/n)"
#TODO: WHICH FILES WOULD YOU LIKE TO MOVE?
#TODO: WHERE WOULD YOU LIKE THE FILES?
case "$answer" in
[yY]) echo "The files are copying. This may take some time."
cp -v /mnt/cdrom/* /mnt/4/TNG_Season1
echo "All files have been copied from the CD to the hard drive."
echo "I will now eject the CD."
*) echo "The files were *NOT* copied.";;
#echo "All files have been copied from the CD to the hard drive."
#echo "I will now eject the CD."
echo "Thank you for using my script!"
Thanks for your time and I hope someone can point me in the right direction.