Date: Sun, 15 Jan 2006 12:20:53 -0500 From: Ronny Hippler <r11roadster@yahoo.com> To: je killen <jekillen@prodigy.net> Cc: freebsd questions <freebsd-questions@freebsd.org> Subject: Re: shell scripts and escaped charecters in file names Message-ID: <43CA8475.70404@yahoo.com> In-Reply-To: <0882f36f000b0fdb49e5b59b8bfc053f@prodigy.net> References: <43C9FB5A.2050506@yahoo.com> <0882f36f000b0fdb49e5b59b8bfc053f@prodigy.net>
next in thread | previous in thread | raw e-mail | index | archive | help
-----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-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43CA8475.70404>