Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII

Liste des GroupesRevenir à cu shell 
Sujet : Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shell
Date : 14. May 2025, 16:02:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250514075025.179@kylheku.com>
References : 1 2 3 4 5 6 7 8
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-05-14, Chris Elvidge <chris@internal.net> wrote:
On 14/05/2025 at 07:28, Brian Patrie wrote:
Chris Elvidge wrote:
 > $ sq=$(echo -ne '\u0027\u2018\u2019\u0022\u201c\u201d')
 
To eliminate needless overhead:
   sg=$'\u0027\u2018\u2019\u0022\u201c\u201d'

So it is needless overhead in a script that is intended
to be portable to certain shells.
The -n option of echo is documented in POSIX (as an XSI extension),
whereas $'...' is a feature of some shells. (Korn, Bash, Zsh?)

There is a small issue with it in Bash in that when you use it
in a function definition, Bash strips away the $'...'
syntax and stores the raw string.
Then when you type "set" (with no arguments) to view the function
definitions, the raw characters are dumped to your terminal,
rather than their escaped representation.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
4 May 25 * How to convert <binaryGlowMixedWithASCII> to pure ASCII25Kenny McCormack
4 May 25 +* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII6Lew Pitcher
4 May 25 i+* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII3Kenny McCormack
4 May 25 ii`* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII2John-Paul Stewart
4 May 25 ii `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Kenny McCormack
5 May 25 i`* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII2Eli the Bearded
5 May 25 i `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Janis Papanagnou
12 May 25 `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII18Chuck Martin
12 May 25  `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII17Kenny McCormack
12 May 25   `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII16Nuno Silva
12 May 25    +* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII14Kenny McCormack
12 May 25    i`* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII13Chris Elvidge
14 May 25    i `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII12Brian Patrie
14 May 25    i  `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII11Chris Elvidge
14 May 25    i   `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII10Kaz Kylheku
14 May 25    i    +* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII7Janis Papanagnou
15 May 25    i    i`* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII6Alexis
15 May 25    i    i +- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Janis Papanagnou
21 May 25    i    i `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII4Lars Poulsen
22 May 25    i    i  `* Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII3Lawrence D'Oliveiro
22 May 25    i    i   +- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Kaz Kylheku
22 May 25    i    i   `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Keith Thompson
15 May 25    i    +- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Brian Patrie
15 May 25    i    `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Geoff Clare
12 May 25    `- Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII1Eli the Bearded

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal