[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is this intended behavior??
From: |
Chet Ramey |
Subject: |
Re: Is this intended behavior?? |
Date: |
Wed, 13 Feb 2013 12:01:18 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 |
On 2/11/13 2:25 PM, Bruce Korb wrote:
>> /tmp
>> $ echo "$PS1"
>> \w\n\$
>> /tmp
>> $ mkdir -p ZZ/a/b/c
>> /tmp
>> $ pushd ZZ
>> /tmp/ZZ /tmp
>> /tmp/ZZ
>> $ pushd a
>> /tmp/ZZ/a /tmp/ZZ /tmp
>> /tmp/ZZ/a
>> $ pushd b/c
>> /tmp/ZZ/a/b/c /tmp/ZZ/a /tmp/ZZ /tmp
>> /tmp/ZZ/a/b/c
>> $ popd /var/tmp
>> /tmp/ZZ/a/b/c /tmp/ZZ/a /tmp/ZZ
>> /tmp/ZZ/a/b/c
>> $ popd /var/tmp
>> /tmp/ZZ/a/b/c /tmp/ZZ/a
>> /tmp/ZZ/a/b/c
>> $
>
> It is behaving as if it were seeing the "-0" option.
It's unspecified behavior. popd doesn't take any `non-option' arguments.
As soon as you specify one, you can't really expect to know what will
happen without experimentation or reading the source.
/var/tmp gets translated to the equivalent of -0 (if you're curious, it's
because `/' isn't `+' and the default directory index is 0).
It should probably be an error instead.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/