Sujet : Re: How to convert <binaryGlowMixedWithASCII> to pure ASCII
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shellDate : 14. May 2025, 19:39:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1002o0k$2l2at$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 14.05.2025 17:02, Kaz Kylheku wrote:
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),
The 'echo -n' could also simply be replaced by 'printf'.
whereas $'...' is a feature of some shells. (Korn, Bash, Zsh?)
Concerning portability the question in the first place is IMO what to
do with those '\u....' . - I don't think this is standard, or is it?
So if it's non-standard we could use arbitrary common but non-standard
shell features.
Like the shell built-in 'printf' without $'...' to use just '...'.
Or IMO best just the already suggested ANSI strings var=$'...' .
Janis
[...]