bug-bash
[Top][All Lists]
Advanced

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

shell-expand-line drops quotation marks


From: Keith Thompson
Subject: shell-expand-line drops quotation marks
Date: Tue, 3 Nov 2015 16:44:30 -0800

The shell-expand-line command (bound to Escape-Ctrl-E) incorrectly removes quotation marks from
the command line, often resulting in a command that differs from what the user intended to type.

I've seem this problem with all recent versions of bash, particularly 4.3.11 (preinstalled on
Linux Mint 17.2) and 4.4-beta (built from source on the same system).


Here's a demonstration:

$ /bin/bash --norc
bash-4.3$ uname -a
Linux bomb20 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
bash-4.3$ echo $BASH_VERSION
4.3.11(1)-release
bash-4.3$ bind -p | grep shell-expand-line
"\e\C-e": shell-expand-line
bash-4.3$ echol() { for word in "$@" ; do echo "$word" ; done ; }
bash-4.3$ echo foo bar
foo bar
bash-4.3$ echol 'string with spaces' !*     # Here I typed just the command you see; it worked.
echol 'string with spaces' foo bar
string with spaces
foo
bar
bash-4.3$ echo foo bar
foo bar
bash-4.3$ echol string with spaces foo bar  # Here I typed the same command, then Escape-Ctrl-E
string
with
spaces
foo
bar
bash-4.3$

I often type Escape-Ctrl-E to expand a history substitution in place
before typing Enter, but it has the side effect of stripping quotes from
what I've already typed.

--

reply via email to

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