[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash' code to store string of any characters containing pair of "" a
From: |
Lawrence Velázquez |
Subject: |
Re: Bash' code to store string of any characters containing pair of "" and '' at once |
Date: |
Sat, 21 Dec 2024 15:39:26 -0500 |
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!!!