The trouble with having spaces in directory or file names is that the shell
interprets each bit of the name as a separate command line parameter and
thinks "hang on , cd (or whatever) can only have one parameter. I'd better
report an error" The answer is to type cd "my dir name thats got spaces in"
The quotes cause the shell not to try and interpret the parameters but to
pass them straight through to the command (ie cd) as a single string.
This is a general technique for whenever you don't want the shell
interpreting your parameters.

Hope this helps

Mike




-----Original Message-----
From: Holly Henry-Pilkington [mailto:[EMAIL PROTECTED]]
Sent: 13 December 2000 16:18
To: [EMAIL PROTECTED]
Subject: Re: [newbie] Spaces in names


Alternatively, assuming you have a directory called "mydir for myprogram"
you could do things like "cd mydir*myprogram" and "chown myname:mygroup
mydir*myprogram". 

The only time I run into this is with guys at work who use Windows
programs to create mp3s and don't choose the option in the program
(assuming the Windows program has one) to convert spaces in the song
titles to underscores.

Holly

Mark Weaver wrote:
> 
> Well...when I attempt to navigate to a dir in a terminal window that has
> spaces in the name I'm told that "no such file or directory" exists and
> if I try to do a chmod, or chown or any type of attribute change on a file
> or dir with a space in the name, then this too fails. I don't think spaces
> "are" legal forms of naming. Otherwise wouldn't the OS allow this?
> 
> I've never known any type *nix to allow this before.
> 
> --
> Mark
> ###############
> ## ...it's not a bug, it's a feature
> ## Registered Linux User # 182496
> ##      <!-- Pine 4.31 -->
> #####################################
> 
> On Wed, 13 Dec 2000 Sridhar Dhanapalan spake passionately saying!
> 
> > Spaces are not illegal at all - you can use them as you wish. I
personally
> > like to use spaces in file and directory names in order to keep my stuff
> > organised. Most programmes support this, but there are a few that I've
> > encountered that don't. I don't think it's a good idea to use spaces
outside
> > your home directories, unless you're sure this won't create any
problems.
> >
> > On Wed, 13 Dec 2000 12:08, Mark's mail wrote:
> > > Wait...I thought spaces "were/are" illegal in *nix?
> > >
> > > Mark
> > >
> > > On Tue, 12 Dec 2000 20:25:28 +0100 (CET), Paul said:
> > > > On Wed, 13 Dec 2000, John Rye wrote:
> > > >  >I would have thought that a space was an undesirable if not
illegal
> > > >  >character in a filename let alone a directory name.
> > > >  >
> > > >  >Is this not the case?
> > > >
> > > >  If it were illegal, I think that someone would have made a program
> > > >  alteration that would prevent you from putting a space in a
directory
> > > >  name. I agree though, that it is undesirable.
> > > >
> > > >  Paul
> > > >
> > > >  --
> > > >  To do is to be  -  Sartre
> > > >  To be is to do  -  Spinoza
> > > >  Do be do be do  -  Sinatra
> > > >
> > > >  http://nlpagan.net - ICQ 147208 - Registered Linux User 174403
> > > >               Linux Mandrake 7.2 - Pine 4.30
> >
> >

Reply via email to