[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unexpanded tilde in DIRSTACK[0]

From: Chet Ramey
Subject: Re: Unexpanded tilde in DIRSTACK[0]
Date: Mon, 30 Oct 2017 11:58:22 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 10/29/17 8:05 PM, Steve Jones wrote:
> While writing a function to save the directory stack as a script, I
> noticed that ${DIRSTACK[0]}, the current directory always has the tilde
> unexpanded.
> This is the same with bash-4.4.12 and bash-4.3.11.
> I was wondering if this is an oversight since DIRSTACK[0] is the same as
> PWD, or intentional.

It's an oversight. It should be expanded, because otherwise the tilde
won't be expanded in something like `cd ${DIRSTACK[0]}', causing it to
fail. I'll fix it. Thanks for pointing this out.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]