From owner-freebsd-questions@FreeBSD.ORG Sun Jan 15 17:21:09 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 25F8C16A41F for ; Sun, 15 Jan 2006 17:21:09 +0000 (GMT) (envelope-from r11roadster@yahoo.com) Received: from mxsf25.cluster1.charter.net (mxsf25.cluster1.charter.net [209.225.28.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4DE143D49 for ; Sun, 15 Jan 2006 17:21:08 +0000 (GMT) (envelope-from r11roadster@yahoo.com) Received: from mxip02a.cluster1.charter.net (mxip02a.cluster1.charter.net [209.225.28.132]) by mxsf25.cluster1.charter.net (8.12.11/8.12.11) with ESMTP id k0FHL6wM030207 for ; Sun, 15 Jan 2006 12:21:07 -0500 Received: from 68-119-38-069.dhcp.spbg.sc.charter.com (HELO [192.168.1.67]) ([68.119.38.69]) by mxip02a.cluster1.charter.net with ESMTP; 15 Jan 2006 12:21:06 -0500 X-IronPort-AV: i="3.99,368,1131339600"; d="scan'208"; a="1826752459:sNHT16964416" Received: from 127.0.0.1 (AVG SMTP 7.1.371 [267.14.17/229]); Sun, 15 Jan 2006 12:20:54 -0500 Message-ID: <43CA8475.70404@yahoo.com> Date: Sun, 15 Jan 2006 12:20:53 -0500 From: Ronny Hippler User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: je killen References: <43C9FB5A.2050506@yahoo.com> <0882f36f000b0fdb49e5b59b8bfc053f@prodigy.net> In-Reply-To: <0882f36f000b0fdb49e5b59b8bfc053f@prodigy.net> X-Enigmail-Version: 0.93.2.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd questions Subject: Re: shell scripts and escaped charecters in file names X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 17:21:09 -0000 -----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-----