bug-bash
[Top][All Lists]
Advanced

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

Re: bug with multiline strings parsing and single-quoted !


From: Eduardo A . Bustamante López
Subject: Re: bug with multiline strings parsing and single-quoted !
Date: Wed, 3 Dec 2014 03:19:53 -0600
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Dec 03, 2014 at 08:57:26AM +0100, Piotr Grzybowski wrote:
> Hey,
> 
>  I think in this case, history_expand lib/readline/histexpand.c:905 is
> invoked with hstring="b\" | echo '!'", and goes wrongly into history
> expansion.
>  Not that I know how to fix it ;-)
Yes, the issue is tricky, because you don't have access to the whole buffer
there (shell_getc), just to the current line (shell_input_line), but the
current line is a fragment of the whole command.

What I don't understand is why bash does history expansion inside shell_getc,
shouldn't it be easier to do it once you have the whole thing?

zsh does that:

| address@hidden ~ % echo x
| x
| address@hidden ~ % echo "
| address@hidden ~ dquote> !!
| address@hidden ~ dquote> "
| echo "
| echo x
| "
| 
| echo x


Also tcsh:

| address@hidden ~ % tcsh
| hp:~> echo x
| x
| hp:~> echo "\
| ? !!\
| ? "
| echo "\
| echo x\
| "
| 
| echo x
| 
| hp:~> 

vs bash:

| address@hidden:~$ echo x
| x
| address@hidden:~$ echo "
| > !!
| echo "
| 
| echo 
| address@hidden:~$ 

It seems hard to change that, though.



reply via email to

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