syntax of mkdir

Wit WitlessIdiot at triad.rr.com
Sun Apr 19 04:53:54 PDT 2009


Jason Erickson wrote:
> Not to nit-pick...but dot-dot is previous directory.
> dot is current directory

Not to nit-pick...but dot-dot is the directory hierarchically one level 
higher than the current working directory. This is often called the 
"parent directory" and is relative to the current working directory ($PWD).

"Previous directory" is ambiguous in that it can mean $PWD/.., as you 
intended, or $OLDPWD as one might reasonably interpret it.

$ echo $PWD
/home/hardtolove

$ cd Desktop
$ echo $PWD
/home/hardtolove/Desktop

$ echo $OLDPWD
/home/hardtolove

$ cd ..
$ echo $PWD
/home/hardtolove
$ echo $OLDPWD
/home/hardtolove/Desktop

> 
> So...no its not the same unless you are currently in $LFS/tools/somedir

And that's a salient point. The choice of untar directory is really up 
to the end user, regardless of the book's recommendation.

So to the OP's point, the "../" form assumes that, per the book 
instructions, the user is now in the directory created during the untar 
process, regardless of where it is. And that "mkdir ../" form creates 
the build directory in the "proper place" (although it could be other 
places and still work) regardless of the the location in the hierarchy 
of the current working directory.

As noted, the "../" form is a nice "short-hand".

><snip>

>> yes, the dot-dot is short-hand for the current directory, less typing.

As noted above, "... short-hand for the parent directory".

>><snip>

HTH
-- 
Wit



More information about the lfs-support mailing list