shell scripts and escaped charecters in file names

Ronny Hippler r11roadster at yahoo.com
Sun Jan 15 09:21:09 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

je killen wrote:
|
| On Jan 14, 2006, at 11:35 PM, Ronny Hippler wrote:
|
| Hello,
|     I am trying to get the following script to run with no success.
| ------------------------------------
| #!/bin/csh
| foreach file (\*vol\*)
| mv $file `basename $file .par2`.PAR2
| echo $file
| end
| ------------------------------------
| and get the following error:
| usage: mv [-f | -i | -n] [-v] source target
| ~       mv [-f | -i | -n] [-v] source ... directory
|
| I know it is because of the spaces and such in the file names. I have
| tried quoting single double and also escaping them but all fails. what
| is the magic? Please cc me off list. thanks!
|
|> tried %20 for space?

can't cause the file name is being inserted by a variable on the fly I
would have to do a rewrite of the filenames in the script and would need
to know all of the characters that needed to be escaped.

on that note is there a definitive list of all characters that need to
be escaped in a file name? Thanks

please cc me off list. thanks again

- --



I don't need a new harddrive, there's 3k free.



Ronny Hippler || Spartanburg SC
http://www.ronnyhippler.com/ || ftp://ftp.vr5.dyndns.org:2112/
PGP key: http://www.ronnyhippler.com/Ronny_Hippler_PGP.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDyoR1N6qJSxoonroRAkbVAJ9dzS1y5OUZZ2rQKwst3P4l+J9rIgCfUV31
d2PkQW1xaiDwcMgI9qJE/3g=
=teKc
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list