From owner-freebsd-questions Wed Sep 23 07:09:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA00649 for freebsd-questions-outgoing; Wed, 23 Sep 1998 07:09:30 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from ns.cityip.co.za (ns.cityip.co.za [196.25.223.140]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA00348 for ; Wed, 23 Sep 1998 07:07:45 -0700 (PDT) (envelope-from wjv@cityip.co.za) Received: from wjv by ns.cityip.co.za with local (Exim 1.82 #2) id 0zLpZo-0002Tf-00; Wed, 23 Sep 1998 16:07:28 +0200 Message-ID: <19980923160728.D9414@cityip.co.za> Date: Wed, 23 Sep 1998 16:07:28 +0200 From: Johann Visagie To: ringlord@bbs.dcoisp.net, freebsd-questions@FreeBSD.ORG Subject: Re: Accessing files with spaces in the names. Mail-Followup-To: ringlord@bbs.dcoisp.net, freebsd-questions@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: ; from ringlord@bbs.dcoisp.net on Sat, Sep 19, 1998 at 02:56:08PM -0500 X-PGP: ftp://ftp.cityip.co.za/users/wjv/pubkey.asc Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 19 Sep 1998 at 14:56 SAT, ringlord@bbs.dcoisp.net wrote: > > I just received a zip file from a client, which contains a series of > files with spaces in the file names. Under most Unix shells, you can quote the file names containing spaces using single or double quotes, e.g. $ mv "silly file" silly_file > when I typed, mv Merchant Lot 1 Photo.jpg merchantlot.jpg > I was told that the files Merchant Lot 1 Photo.jpg could not be found. > How does one go about accessing these files with such long names? > I have even tryed inserting . _ marks, but nothing works. If you're using a sh-derived shell, you can do something like this to change the spaces to underscores in all filenames in the current directory: for i in *' '*; do mv "$i" `echo $i | sed 's/ /_/g'` done -- V Johann Visagie | Email: wjv@CityIP.co.za | Tel: +27 21 419-7878 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message