Hi everyone,
Now my problem is a bit of an obscure one, but bear with me. I wrote a little program to extract a complete filename from a log file, and now I want to have rm delete that file by entering:
rm `filenamefinder`
Unfortunately, the file path the filenamefinder program provides has a space in it. I made two versions of the finder program with the following outputs, minus quotes:
"/onedirectory/another/Spaced Directory/foo.bar"
"/onedirectory/another/Spaced\ Directory/foo.bar"
The problem is that rm gives the following errors:
[ky@tails ~]$ rm `~/filenamefinder`
rm: cannot remove `/onedirectory/another/Spaced': No such file or directory
rm: cannot remove `Directory/foo.bar': No such file or directory
[ky@tails ~]$ rm `~/filenamefinder2`
rm: cannot remove `/onedirectory/another/Spaced\\': No such file or directory
rm: cannot remove `Directory/foo.bar': No such file or directory
So basically whether I have "Spaced Directory" or "Spaced\ Directory" being output by my program, rm still thinks they are two different names. How can I convince it they're one?
Thanks,
-K.W.
P.S. folder names changed to protect the innocent