bug-bash
[Top][All Lists]
Advanced

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

Re: Expansion of exclamation mark in single quotes in subcommand


From: Chet Ramey
Subject: Re: Expansion of exclamation mark in single quotes in subcommand
Date: Mon, 21 Apr 2014 12:45:29 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 4/21/14, 12:10 AM, Maxdamantus wrote:
> version: 4.3.11(5)
> 
> This seems like a bug, but it seems to have been here for a few years
> (from the git repository, bash-3.0 displays this behaviour while
> bash-2.05b doesn't).

The history expansion code knows nothing about shell syntax, and barely
understands quoting.  It knows about backslashes, double quotes, and
single quotes, and knows that single quotes don't have any special meaning
inside double quotes.  It's performed immediately after the shell reads a
line, and it happens over the entire line.

With those conditions, you should be able to figure out the behavior of
the expansion FSM.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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