bug-bash
[Top][All Lists]
Advanced

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

Re: Expansion of exclamation mark in single quotes in subcommand


From: Chris Down
Subject: Re: Expansion of exclamation mark in single quotes in subcommand
Date: Mon, 21 Apr 2014 22:26:47 +0800
User-agent: Mutt/1.5.23 (2014-03-12)

Maxdamantus writes:
> This seems like a bug, but it seems to have been here for a few years
> (from the git repository, bash-3.0 displays this behaviour while
> bash-2.05b doesn't).
> 
> With history expansion enabled (set +H):
> 
> $ echo '!!' # good
> !!
> $ echo "$(echo '!!')" # not good; !! expands
> echo "$(echo 'echo '!!'')"
> echo !!
> $ echo '$$' # good
> $$
> $ echo "$(echo '$$')" # good
> $$

I'm not totally sure why you think this is a bug. How can bash know what
quoting style was used inside the command substitution? This is normal
behaviour when history expansion is performed inside a double quoted
block.

Perhaps if you explained the reason you think this is a bug better,
someone could give a more meaningful reply. :-)

Attachment: pgpjn5O8an8Im.pgp
Description: PGP signature


reply via email to

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