> On Aug 22, 2021, at 10:22 PM, Koichi Murase <myoga.mur...@gmail.com> wrote:
> 
> 2021年8月23日(月) 6:13 Emanuele Torre <torreemanue...@gmail.com>:
>> 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.
> 
> It seems to me that you can just put '$par' (not "$par") in PS1.
> Then, the suggested "${par@p}" can be simply '$par', which isn't worth
> implementing as a new transform.  You can write
> 
>  PS1='blabla $tmp_var blabla'
> 
> Or
> 
>  PS1="blabla \$tmp_var blabla"

An example in the original post asserted that tmp_var "will not
exist when PS1 is expanded", so it must be inserted when PS1 is
defined.  This requirement seems pretty contrived to me (why can't
tmp_var be kept around, exactly?), but that's what was postulated.

-- 
vq


Begin forwarded message:

> From: Emanuele Torre <torreemanue...@gmail.com>
> Subject: [feature request] parameter transformation to safely add strings to 
> PS1, &c.
> Date: August 22, 2021 at 5:11:53 PM EDT
> To: bug-bash@gnu.org
> 
> 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.
> 
> example:
> 
>  tmp_var=$(blabla) # this variable will not exist when PS1 is expanded
>  PS1="blabla ${tmp_var@p} blabla"

Reply via email to