[Pkg-zsh-devel] Bug#1022758: Bug#1022758: zsh doesn't recognise double quotes with an exclamation mark

Michael Prokop mika at debian.org
Tue Oct 25 11:01:03 BST 2022


close 1022758
thanks

Hi,

* Tanmay [Tue Oct 25, 2022 at 03:20:54PM +0530]:

> When I type `echo 'Hello!'`, it prints `Hello` but when I use double quotes
> instead of single quotes, there is no output and the shell waits for the
> quote to end.
> Here is  a transcript!
> 
> $ echo 'Hello!'
> Hello
> $ echo "Hello!"
> dquote>
> 
> I suggest that the shell should recognise the quotes.
> I am using Ubuntu 20.04 and kernel 5.15.0-52-generic.

"!" has a special meaning in zsh, so this behaves as expected and
documented. You need to use single quotes or drop "!" from
$histchars, if you want to disable this behavior.

See section `QUOTING` in `man zshall`, quoting from there

| Inside double quotes (""), parameter and command substitution occur,
| and `\' quotes the characters `\', ``', `"', `$', and the first
| character of $histchars (default `!').

regards
-mika-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-zsh-devel/attachments/20221025/c28d611a/attachment-0001.sig>


More information about the Pkg-zsh-devel mailing list