Subject: Re: rmdir(".")
To: Alan Barrett <apb@cequrux.com>
From: Ben Collver <collver@peak.org>
List: tech-kern
Date: 09/09/2005 06:13:16
On Fri, Sep 09, 2005 at 12:58:10PM +0200, Alan Barrett wrote:
> On Fri, 09 Sep 2005, Roland Illig wrote:
> > Alan Barrett wrote:
> > >"rmdir $(pwd)" works.  "rmdir ." is not allowed.
> > 
> > did you mean this:?
> > $ rmdir "$(pwd)"
> 
> Of course, I would not actually do that without proper quoting around
> the "$(pwd)", but nested levels of quotes would have made my comment
> harder to read.

There is no need to quote command expansion, so your original example
was whitespace safe.

$ mkdir "dir a" && cd "dir a"
$ sh -c 'foo=$(pwd); echo $foo'
/home/ben/dir a

Cheers,

Ben