bug-bash
[Top][All Lists]
Advanced

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

Multi-line, double quoted string triggers history expansion on subsequen


From: Néstor Tejero
Subject: Multi-line, double quoted string triggers history expansion on subsequent single-quoted commands it gets piped to
Date: Tue, 14 Jun 2016 14:52:45 +0200

Hello,
This is my system:

$ bash --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)

$ uname -a
Linux PCNTEJERO 3.19.0-51-generic #58~14.04.1-Ubuntu SMP Fri Feb 26 22:02:58 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
ntejero@PCNTEJERO: ~
$ cat /etc/*ease
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17.3
DISTRIB_CODENAME=rosa
DISTRIB_DESCRIPTION="Linux Mint 17.3 Rosa"
NAME="Ubuntu"
VERSION="14.04.4 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.4 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
cat: /etc/upstream-release: Is a directory

Bash was installed through "apt-get install --only-upgrade bash"

The bug:
When printing a multi-line string and piping to another command that uses single-quotes, Bash tries to perform history expansion:

echo "9
> 10
> 9
> 11" | awk '!seen[$0]++'
bash: !seen[$0]++': event not found

$ echo "9
> 10
> 11" | echo '!a'
bash: !a': event not found

Turning history off solves it, but anyway history expansion should not occur within single-quotes. This does not happen in single lines:

$ printf "23\n24\n25" | echo '!a'
!a



Néstor

reply via email to

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