Greetings fellow linuxers. I'm working on a script to move files from a Windows box onto a Linux server. I'm doing this in 4 steps.
Step 1 uses the Samba Client to get a directory of the Windows Share.
Step 2 copies the files one at a time using get or mget depending on the name type (short or long)
Step 3 removes the file from the Windows share.
Step 4 move the file from /tmp to the desired target
The problem I'm having is when the user "goes nuts" using the "long file" name in Windows. Mget lets me "wildcard copy" the file over. del works on the mget name. Here's the copy of a file that makes /bin/mv fail:
mv 'killprogram\!$_&____#$.logI#($#$~@!#!@#(!(%$#%$#%$%\'#($#($#$#&$#@${.xls' test
Returned message:
mv: line 1: unexpected EOF while looking for matching `"'
mv: line 2: syntax error: unexpected end of file
google hasn't really been helpful in solving this one
*** Here's the answer I found ***
Got the Inode of the file using perl -stat function
did this command
find / -inum #### -exec mv {} test \;
This moves the file using inode from where you found it to where you want it.