bug-bash
[Top][All Lists]
Advanced

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

Re: inconsistent treatment of backslash-bang


From: Chet Ramey
Subject: Re: inconsistent treatment of backslash-bang
Date: Wed, 16 Jul 2008 13:48:36 -0400

> Machine Type: x86_64-pc-linux-gnu
> 
> Bash Version: 3.2
> Patch Level: 39
> Release Status: release
> 
> Description:
>       In all contexts in which a character "X" has special meaning to bash, 
> it should
>       be possible to insert that character literally by writing "\X". This 
> fails in
>       one case: where "X" is "!", and the context is inside double quotes.

Yes, this is where the semantics of history expansion clash with traditional
shell behavior.  Only single quotes inhibit history expansion.

> The following patch (adding "!" to the "slashify_in_quotes" set) seems to fix
> the problem:

Unfortunately, this violates Posix and traditional sh behavior.

If you want fully sh-compatible behavior, you have to turn off history
expansion (set +o history).

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://tiswww.tis.case.edu/~chet/




reply via email to

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