shell scripts and escaped charecters in file names

Ronny Hippler r11roadster at yahoo.com
Sat Jan 14 23:36:07 PST 2006


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

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!

- --

Backup not found: (A)bort (R)etry (P)anic

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

iD8DBQFDyftaN6qJSxoonroRAo/bAJ4hLG6hKvol/bnKFcfPL8cwES6c7wCbBC2s
U1nF938YAhkfCeYasCA/Gtk=
=uU/t
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list