Subject: Re: rmdir(".")
To: Ben Collver <collver@peak.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 09/09/2005 10:10:04
In message <20050909140550.GF6683@sanctum.takilma.net>, Ben Collver writes:
>On Fri, Sep 09, 2005 at 03:26:47PM +0200, Roland Illig wrote:
>> Ben Collver wrote:
>> >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
>> 
>> You're comparing apples with oranges here. Alan wrote:
>> 
>>   rmdir $(pwd)
>> 
>> and you wrote:
>> 
>>   foo=$(pwd); echo $pwd
>> 
>> You know that the quotes are not needed with variable assignments, do 
>> you? That's the difference here.
>
>Thanks for the correction.
>
>Looking through my scripts directory, I found a couple faults due to
>this misunderstanding. ie: if [ -f $(basename "$URL") ]
>

I'd leave the quotes in that spot.  The issue is whether or not URL 
has, say, embedded blanks.

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb