On Sat, Dec 21, 2024, at 1:52 PM, Greg Wooledge wrote:
> On Sat, Dec 21, 2024 at 09:56:15 -0800, Eric Pruitt wrote:
>> You need to escape one of the types of quotes. Double quotes is
>> generally simpler:
>
> Only in this restricted case. Using double quotes as the outer layer
> means you have to backslash-escape *lots* of other characters inside
> the payload: double quotes, dollar signs, backticks, and backslashes
> at the very minimum.
Including exclamation points when history expansion is enabled in
non-POSIX mode! Except those backslashes aren't removed!!
$ set -H +o posix
$ echo "hello!!"
echo "helloset -H +o posix"
helloset -H +o posix
$ echo "hello\!!"
hello\!!
--
vq!!!