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> =================================================================== Author: Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)