I am trying to write a function that I will put on all my machines in order to make it easy to send files at a fixed place on my network.
Here is my script so far. Some folder may have duplicates names on my machines, so I'm adding a uuid at the end of the folder name.
function putOnSG3() {
uuid=`uuidgen`
if [[ -d $1 ]]; then scp -rv "$1" shiny:/Volumes/Seagate3To/"$1.$uuid";
else echo $1 " is not a directory. Not copying.";
fi;
}
I'm invoking it like this:
$ putOnSG testFo\[l\}der
Here is the problem:
zsh:1: bad pattern: /Volumes/Seagate3To/testFo[l}der.d84abc26-501b-4f89-a636-518b4059a770
How can I manage these nasty filenames ?
Target filesystem is case sensitive hfsplus, source filesystems are various extfs from Linux machines and NTFS.
