[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: History expansion in multiline string, within single quote
From: |
Chet Ramey |
Subject: |
Re: History expansion in multiline string, within single quote |
Date: |
Thu, 9 Aug 2018 10:32:34 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 8/9/18 3:47 AM, schplurtz@laposte.net wrote:
> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
>
> Description:
> Bug happens in an interactive shell.
>
> this works as expected, no history expansion :
> echo "foo"'!bar'"qux"
>
> but this fails, bash tries to hist-expand !bar', which it should not.
> echo "foo
> "'!bar'"qux"
>
> -bash: !bar': event not found
>
> I just compiled bash 4.4.18 and tested, the bug is there too.
Since the history library is explicitly line-oriented, and independent of
the shell, there hasn't been a clean way to inform it about any quoting
state the current line should inherit.
I added an experimental new state variable that will appear in
readline-8.0-beta that should allow applications to communicate this
state to the history library. We'll see how it works.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/