Re: PS-embedded comsub `\w' evaluation doesn't replace $HOME with ~

2017-03-13 Thread Grisha Levit
On Mon, Mar 13, 2017 at 9:00 AM, Chet Ramey wrote: > Backslash-escape evaluation happens before parameter expansion, as > documented. Oh duh the unquoted `~' is expanded by echo. Sorry for the noise.

Re: Bash Manual inconsistency regarding PS* in which expansions apply

2017-03-13 Thread Chet Ramey
On 3/12/17 5:14 PM, Grisha Levit wrote: > The manual says [1]: > > In addition, the following table describes the special characters which > can > appear in the prompt variables PS1 to PS4: > > ..which misses PS0 (and seems to imply that PS3 gets expanded in this > fashion as well). > >

Re: PS-embedded comsub `\w' evaluation doesn't replace $HOME with ~

2017-03-13 Thread Chet Ramey
On 3/12/17 4:46 PM, Grisha Levit wrote: > For example: > > $ PS1='\w $(echo \w) $ ' > ~ /home/levit $ Backslash-escape evaluation happens before parameter expansion, as documented. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hipp