Subject: Re: shell expansions
To: None <current-users@netbsd.org>
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
List: current-users
Date: 08/01/2000 01:33:22
chet@nike.ins.cwru.edu (Chet Ramey) writes:
> > But remember that this also effects command line expansion inside
> > shell scripts. There are plenty of times you want dollar-sign
> > expansion inside a shell script but don't want what is essentially a
> > lame keyboard editing interface. (If one wants a previous command in
> > bash one can use Ctrl-R, or Ctrl-P which is quite a bit more WYSIWYG.)
>
> History expansion is not enabled when the shell is not interactive. A
> quick read of the man page would have told you that.
Perhaps I was cutting and pasting sections of my script file.
Things weren't working well and bash's expansion of ! inside double
quotes wasn't adding to my general computer enjoyment.
But since we are talking about reading the bash man page, please let
me enter exhibit A into evidence. ;-)
Enclosing characters in double quotes preserves the lit-
eral value of all characters within the quotes, with the
exception of $, `, and \. The characters $ and ` retain
their special meaning within double quotes. The backslash
retains its special meaning only when followed by one of
the following characters: $, `, ", \, or <newline>. A
double quote may be quoted within double quotes by preced-
ing it with a backslash.
No where do I see mention of ! being expanded in quotes. Since other
shells don't do this, I would think the path of least surprise is to
change bash to not do it either.
-wolfgang
--
Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
http://www.wsrcc.com/wolfgang/
DGPS signals via the Internet http://www.wsrcc.com/wolfgang/gps/dgps-ip.html