[Top][All Lists]

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

Re: inconsistent treatment of backslash-bang

From: Chris F.A. Johnson
Subject: Re: inconsistent treatment of backslash-bang
Date: Wed, 16 Jul 2008 18:36:19 +0000
User-agent: slrn/ (Linux)

On 2008-07-16, Chet Ramey wrote:
>> 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).

   I find it adequate to set histchars to an empty string.

   Chris F.A. Johnson, webmaster         <http://Woodbine-Gerrard.com>
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)

reply via email to

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