Subject: Re: shell expansions
To: Wolfgang Rupprecht <firstname.lastname@example.org>
From: gabriel rosenkoetter <email@example.com>
Date: 07/29/2000 18:48:38
On Sat, Jul 29, 2000 at 12:42:13AM -0700, Wolfgang Rupprecht wrote:
> Are shells allowed to expand '!'s inside double quotes? The most
> recent bash (2.04.0(1)-release (i386--netbsd)) gripes about the
> $ echo "ouch!"
> bash: !": event not found
> In contrast, /bin/sh echos "ouch!" exactly as I had expected.
... and zsh yields:
ambriel:~% echo "ouch!"
(It can't find !", but it's not going to complain till you close those
damn quotes... when it proceeds not to complain, but to drop the !
Personally, I *like* the fact that command history is expanded in
double quotes. That could be pretty handy. If you didn't want
expansion, you should have used single quotes. If you're using double
quotes, you're thinking about expansion, and you should escape
~ g r @ eclipsed.net