Mar 13, 2015, 3:47 AM
Post #1 of 2
perl filenames with & (ampersand)
Im trying to run a command on many file using bash
create the function
tail -c 128kB "$1" | md5sum | perl -pe 's&-&'"$1"'&'
find . -type f | xargs -0 -P 0 -I name bash -c 'myfunc "name"'
this works fine and the function is run correctly against all the files found
But when a "&" is encountered in the filename the scripts faults
any help appreciated