[NTLUG:Discuss] Existance of '//' directory?

Rick Renshaw bofh69 at yahoo.com
Tue Feb 5 19:13:43 CST 2008


--- Eric Waguespack <ewaguespack at gmail.com> wrote:

> My understanding is that it is a POSIX requirement.
> 
> 
> On Feb 5, 2008 5:10 PM, Chris Cox <cjcox at acm.org> wrote:
> > David Simmons wrote:
> > >
> > > Guys - try this:
> > >
> > > cd //
> > >
> > > what is a // directory?
> > > Of course, it appears to be 'root'...but why does this root-root
> > > work?  Is it a carry-over from some previous *nix?  Is it any
> > > different than normal '/'?
> >
> > Normal.
> >
> > Try: cd ///////////////////////
> >
> > Let's just say, there is only one root.
> >
> > Not sure of the history, but does keep a lot of broken
> > software happy.


It also help avoid problems when you write scripts like this:

HOME=/home/
RICK=$HOME/rick/
RICKMAIL=$RICK/Maildir

cd $RICK 

In this case, $RICKMAIL expands to /home//rick//Maildir but it still "does the right thing"
because the extra slashes are collapsed.

Be vewwy, vewwy qwiet, I'm hunting Jedi.
          Darth Fudd.


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 




More information about the Discuss mailing list