Hi
New to bash scripting, I'm writing a script to copy my TV shows accross from a download folder to an archive folder.
So far I have this:
find `*`show1`*`.avi | cp \"" $0 "\" "/mnt/main/data/tv/Show1"
find `*`show2`*`.avi | cp \"" $0 "\" "/mnt/main/data/tv/Show2"
I understand this is not the best method, but my skills of bash are quite limited.
I need to know how I can copy that found file, or do nothing if it doesnt find anything matching (this will be a cron script). eg.
find `*`show1`*`.avi | cp "show1.hello.world.xvid.avi" "/mnt/main/data/tv/Show1"
find `*`show2`*`.avi | cp "show2.foo.bar.xvid.avi" "/mnt/main/data/tv/Show2"
find `*`show3`*`.avi | cp "null (nothing found)" "/mnt/main/data/tv/Show3"
Thanks!
EDIT: Solved http://pastebin.com/aNLihR86