The files I am trying to manipulate include spaces in the file names, and I cannot seem to escape them effectively. If I try something like:
#find /usr/home -name *.rtf.exe -print0 | perl -p -e 's/\ /\\\ /g;' | xargs -0 -J % mv % /usr/newplace/
Then although all spaces are preceded by backslashes I get errors every time a space is encountered. So for a file at /usr/home/user/this is a file.rtf.exe I get file does not exist errors from mv at:
/usr/home/user/this\
and at:
is\
and at:
a\
and at:
file.rtf.exe (yes, a windows virus on a network share has been busy).
I have also tried
#find /usr/home -name *.rtf.exe -print0 | perl -p -e 's/\ /\\\ /g;' > listofdodgyfiles
and the list is fine. If I paste a line into mv on the command line, it works. If I use a simple script to read the file, same errors as mentioned above.
I'm sure I'm missing something obvious... Any nudges in the right direction would be gratefully received.
PWR.
_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"