gnu.bash.bug
[Top] [All Lists]

Re: inconsistent treatment of backslash-bang

Subject: Re: inconsistent treatment of backslash-bang
From: Lawrence D'Oliveiro <ldo@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 19 Jul 2008 17:29:37 +1200
Newsgroups: gnu.bash.bug

Chet Ramey wrote:

> I already explained that bash follows csh as closely as possible
> in its history expansion implementation.

Well, it doesn't:

ldo@hypatia:~> /bin/tcsh
hypatia /home/ldo> echo hi there!0
0: Event not found.
hypatia /home/ldo> echo "hi there!0"
0: Event not found.
hypatia /home/ldo> echo "hi there\!0"
hi there!0
hypatia /home/ldo> echo hi there\!0
hi there!0

(Compare the bash output in my bug report.)

> This means that backslash doesn't escape the !, and isn't removed.

If it doesn't escape the !, then how come the ! doesn't have its usual
history-expansion meaning? Either \ acts as an escape or it doesn't, having
it part of one and part of the other is an inconsistency. Simple as that.




<Prev in Thread] Current Thread [Next in Thread>