Re: [feature request] parameter transformation to safely add strings to
From:
Chet Ramey
Subject:
Re: [feature request] parameter transformation to safely add strings to PS1, &c.
Date:
Mon, 23 Aug 2021 11:51:41 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0
On 8/22/21 5:11 PM, Emanuele Torre wrote:
> It would be nice to have a parameter transformation (e.g. "${par@p}")
> that expands $par to a string that will not be expanded by PS1, PS2, &c.
So you want it to be expanded at some point, but its value not subject to
any of the prompt string expansions (\a, \d, \t, and so on)?
>
> example:
>
> tmp_var=$(blabla) # this variable will not exist when PS1 is expanded
This seemns to be the key requirement. Otherwise, you would be able to
simply write PS1="blabla \${tmp_var} blabla" as others have suggested.
I'm not sure that requires a new transformation (which would have to be
much more completely specified than it has been so far).
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/