bug-bash
[Top][All Lists]
Advanced

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

Re: bash: History substitution doesn't happen after ^V^J.


From: Chet Ramey
Subject: Re: bash: History substitution doesn't happen after ^V^J.
Date: Mon, 18 Oct 2004 17:18:03 -0400

> Version: 2.05a-11
> 
> Type the following.
> 
>     $ echo foo<Return>
>     foo
>     $ echo !$<Return>
>     foo
>     $ echo 'a^V^J
>     b' !$<Return>
>     a
>     b !$
>     $
> 
> If I split the quoted string over multiple lines, history substitution
> doesn't seem to happen apart from on the first line.

History expansion is done on a per-line basis, not per-token.  It is performed
before the shell parser sees the line.

At the point the second line is read and history expanded, the parser's state
is still `open single quote', so expansion is inhibited.

I'd rather err on the side of not performing history expansion where it could
possibly be done instead of performing it when it should not.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

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