Sujet : Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shellDate : 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/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca