Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "history" modifier question




On Thu, May 4, 2023 at 7:19 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

You can do it like this:  ${(e):-\${PWD:h${N}}}

Yes that works, Thanks.
    e Perform single word shell expansions,
Had to think about that for a second, but got it. Learned my something new for
today. :-)

Yes, the digit following :h has to be a literal digit, not an expansion.

Darn, it would have been nice, but your example is just fine.

Regards,

Jim Murphy


Messages sorted by: Reverse Date, Date, Thread, Author