bug-bash
[Top][All Lists]
Advanced

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

Re: ! in PS1 in posix mode


From: Chet Ramey
Subject: Re: ! in PS1 in posix mode
Date: Sun, 11 Oct 2015 16:22:52 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 10/11/15 2:22 AM, isabella parakiss wrote:
> On 10/11/15, isabella parakiss <izaberina@gmail.com> wrote:
>> In posix mode, bash replaces ! in my PS1 with the history number.
>>
>> $ PS1=' ! '
>>  ! set -o posix
>>  513 exit
>>
>> It doesn't happen with any other prompt escape sequence, afaict.
>> This looks... intentional?  WTF?
>>
> 
> Ok I've now read this page: http://tiswww.case.edu/php/chet/bash/POSIX
> This is awful.
> 
> I found out this by enabling set -o posix in my interactive shell.  bash
> replied with an endless loop of syntax errors because there's this in my
> PS1:  ${var[a != b]}
> Then bash decided to eat up as much cpu and memory it could grab, and I
> had to kill-9 it.
> 
> I understand that changing the standard in unfeasible but a syntax error
> in PS1 shouldn't destroy the shell.

You're right.  I found the code path that didn't honor the "expanding
prompt string, don't jump back to the top level" flag and fixed it.
Thanks.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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