On 9/8/17 4:18 AM, Philipp Sasse wrote:

>   Executing something like
>     echo "foo
>     bar" | sed '/foo/!d'
>   results in an error. Apparently the history expansion considers only 
> quoting characters on the same input line, so the closing double quote is 
> taken as opening double quote, escaping the following single quotes, thus 
> these don't escape the ! anymore.

History expansion is explicitly line-oriented, and always has been. There's
not a clean way to make it aware of the shell's current quoting state
(mostly since it's a library independent of the shell). Maybe there's a way
to use one of the existing callback functions to do it.

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

Reply via email to