bug-bash
[Top][All Lists]
Advanced

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

Re: [feature request] parameter transformation to safely add strings to


From: Koichi Murase
Subject: Re: [feature request] parameter transformation to safely add strings to PS1, &c.
Date: Mon, 23 Aug 2021 11:22:25 +0900

2021年8月23日(月) 6:13 Emanuele Torre <torreemanuele6@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"

If you want to modify the variable later, you can save it in a
different variable.

  PS1_tmp_var=$tmp_var
  PS1="blabla \$PS1_tmp_var blabla"

--
Koichi



reply via email to

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