Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Sep 1998 23:46:09 -0400 (EDT)
From:      Rob DeMarco <drifter@localhost.net>
To:        BEAUPRE Antoine <beaupran@JSP.UMontreal.CA>
Cc:        ringlord@bbs.dcoisp.net, freebsd-questions@FreeBSD.ORG
Subject:   Re: Accessing files with spaces in the names.
Message-ID:  <Pine.BSF.4.02A.9809202331010.1357-100000@localhost.net>
In-Reply-To: <Pine.SGI.3.96.980920104607.24622E-100000@derby.jsp.umontreal.ca>

next in thread | previous in thread | raw e-mail | index | archive | help


On Sun, 20 Sep 1998, BEAUPRE Antoine wrote:

> On Sat, 19 Sep 1998 ringlord@bbs.dcoisp.net wrote:
> 
> > Greetings folks.
> > I just received a zip file from a client, which contains a series of
> > files with spaces in the file names.
> 
> > For example, when I do an ls on the directory the files are zipped into,
> > one of the files has a name of Merchant Lot 1 Photo.jpg
> 
> > This zipfile was created on a win95 machine that allows long file names.
> > I have tryed to figure out how to rename these files to files with one
> > name to them.
> > when I typed, mv Merchant Lot 1 Photo.jpg merchantlot.jpg
> 
> Try:
> % mv Merchant\ Lot\ 1\ Photo.jpg merchantlot.jpg
> 
> It works under tcsh. Anyways, any shell that knows about filename
> completion will complete the filename to a compatible filename.

	A word of warning -- the original `csh' will /not/ properly
quote spaces and other "metacharacters" when using file completion. 
	The `\' trick should work with any self-respecting shell,
but it's probably easier in this case just to use the single or double
quotes.

  % mv 'Merchant Lot 1 Photo.jpg' Merchant_Lot_1_Photo.jpg

        ought to work under any shell out there (/bin/sh, /bin/csh,
/usr/local/bin/{bash,pdksh,zsh} ...).  Double quotes (") will work
too, but be careful about `$' in your file names, because `$words's
will usually be interpreted as a variable and replaced (probably
with nothing.)

	Oh well, `man sh' or `man csh' should give some of the gory
details. 

> 
> > 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.
> 
> Normal. Marks and dots and such will make a different filename, in tcsh,
> '\' is the escape char, which means "the following must be treated as
> such".
> 
> +-----------------------------------+
> |  Free the world from businessmen  |
> |   Free yourself from your money   |
> +-----------------------------------+
> Free the web. 
> Spidey
> 
> visit: http://www.JSP.UMontreal.CA/~beaupran

	-Rob




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.02A.9809202331010.1357-100000>