bug-bash
[Top][All Lists]
Advanced

[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: Robert Elz
Subject: Re: Bash' code to store string of any characters containing pair of "" and '' at once
Date: Sun, 22 Dec 2024 07:29:14 +0700

    Date:        Sat, 21 Dec 2024 13:49:48 -0500
    From:        Greg Wooledge <greg@wooledge.org>
    Message-ID:  <20241221184948.GM29532@wooledge.org>

  | Choice #2: use $'...' quoting,
  | Choice 2 is a bash extension.

No it isn't, or at least not any more.   Dollar-Quote quoting (sometimes
called C-stye strings) is in the latest POSIX standard.

I'm not sure of its origins (it was proposed to POSIX decades ago),
Chet can confirm, but I suspect bash picked it up from the proposal
to POSIX.

This form of quoting will be found in any shell claiming to be even
close to up to date now (but beware of using it outside what is specified
to work, once you go there, behaviours are not identical).

kre




reply via email to

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