Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gn uname output: Linux 64ws1231 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Version: 4.4 Patch Level: 12 Release Status: release Description: Executing something like echo "foo bar" | sed '/foo/!d' results in an error. Apparently the history expansion considers only quoting characters on the same input line, so the closing double quote is taken as opening double quote, escaping the following single quotes, thus these don't escape the ! anymore. Repeat-By: Can be easily reproduced with the given command (of course set -H) Fix: I have no patch ready, but parsing for history expansion needs to consider the whole input, not just the current line.
Best regards, Philipp.