[Tcsh] backslashed escape sequences in echo

Michal Szymanski msz at astrouw.edu.pl
Tue Jul 2 09:52:29 UTC 2024


Hi,

I've just noticed a changed behavior of 'echo' command with octal
\xxxx sequence. Most of the machines run Rocky Linux 8.10 with tcsh
6.20.00. One of my aliases includes command (simplified here)
  echo "a \0140 b"
which has been working for years giving
a ` b

Now on my Ubuntu desktop recently upgraded to 24.04, coming (what a
coincidence :) with tcsh 6.24.10, this has broke and the output is now
a 
  0 b

To get the previous behavior, I have to remove the 0, echo "a \140 b"

It works as such even if I change $echo_style from the default "both"
to "sysv" when it should, AFAIU, mimic the SYSV behavior of echo(1).
This is not true as the echo(1) requires 0 before 1 to 3 octal digits,
at least in the manual:

       \0NNN  byte with octal value NNN (1 to 3 digits)

In the real world, however, both versions give the octal-coded char:

>/usr/bin/echo -e "a \140 b"
a ` b
>/usr/bin/echo -e "a \0140 b"
a ` b

Is that to be expected? When was it introduced? I cannot find any
"Changelog" file in tcsh sources. There is "Fixes" file, and "BUGS"
file, but no Changelog. The most recent mention of 'octal' in "Fixes"
is from May 12, 2010 and refers to V6.17.02.

best, Michal

-- 
  Michal Szymanski (msz at astrouw dot edu dot pl)
  Warsaw University Observatory, Warszawa, POLAND


More information about the Tcsh mailing list