[Tcsh] "Readable" Unicode in setenv
Jamie Landeg-Jones
jamie at catflap.org
Mon Dec 13 10:33:43 UTC 2021
"H.Merijn Brand" <tcsh at tux.freedom.nl> wrote:
> > What bash and /bin/sh (on NetBSD and FreeBSD) have are all the other
> > escapes. So $'\u....' would seem the most universal one to commit to
> > muscle-memory.
>
> And it probably will be. I was obviously not explicit enough: I never
> used $'' anywhere before with whatever is there between the quotes
>
> To *me* \x{NNNN} is the most intuitive notation, as I live in a perl
> world, but \u is much clearer from a shell-user's viewpoint, and it is
> something I can easily get used to
As someone used to sh, but with little knowledge of perl, $'' is a nice
clean method, with a well defined syntax. "\x{NNNN}" is a weird exception
to an already defined method which breaks backward compatibility in a
potentially unexpected way!
Though of course, you could say the $'' method isn't backward compatible
either, but at least it produces an error!
"catflap" has the new tcsh. "catnip" doesn't :
| 10:25 (45.0°C 400) [2] (1) "/tmp" jamie at thompson% sh
| DEBUG: /etc/sh.shrc
| "tmp" jamie at thompson$$
| "tmp" jamie at thompson$$ ssh -q jamie at catnip ' printf '\''set echo_style=both; echo "\\x{4555}"'\'' | tcsh -xf'
| set echo_style=both
| echo \x{4555}
| \x{4555}
| "tmp" jamie at thompson$$
| "tmp" jamie at thompson$$ ssh -q jamie at catflap ' printf '\''set echo_style=both; echo "\\x{4555}"'\'' | tcsh -xf'
| set echo_style=both
| echo \x{4555}
| 䕕
| "tmp" jamie at thompson$$
| "tmp" jamie at thompson$$ ssh -q jamie at catnip ' printf '\''set echo_style=both; echo $\047\\x{4555}\047'\'' | tcsh -xf'
| Illegal variable name.
| "tmp" jamie at thompson$$ ssh -q jamie at catflap ' printf '\''set echo_style=both; echo $\047\\x{4555}\047'\'' | tcsh -xf'
| set echo_style=both
| echo 䕕
| 䕕
| "tmp" jamie at thompson$$
Cheers, Jamie
More information about the Tcsh
mailing list