Seb dixit:

>It seems there is a problem in the way the R48b deals with the
>spaces in the variables. Below is a piece of code showing the strange

Thanks for bringing this to my attention. Indeed, there appears to be
field splitting not done correctly, but at least it’s not m̲y̲ fault ☺

tg@frozenfish:~ $ pdksh -c 'x="X 1"; echo shift ${x#X}'
shift  1

(That on Debian etch.)


Looking further¹:

tg@blau:~ $ x="X 1"; dumpargs shift ${x#X}
args(3) 0:/usr/local/bin/dumpargs 1:shift 2: 3:1
tg@blau:~ $ x="X 1 2"; dumpargs shift ${x#X}
args(4) 0:/usr/local/bin/dumpargs 1:shift 2: 3:1 4:2

So, apparently, the leading space creates an empty field.

Meh. On the other hand…

tg@blau:~ $ mksh /usr/src/contrib/code/Snippets/ifs.sh
# tests 6856 passed 6856 failed 0

The script – now http://www.research.att.com/~astopen/public/ifs.sh
as everything ~gsf/ seems to have been moved – hasn’t changed either,
which means you found something not covered by any existing tests.

I’ll look at this.

bye,
//mirabilos

① https://www.mirbsd.org/cvs.cgi/contrib/hosted/tg/dumpargs?rev=HEAD
-- 
„Also irgendwie hast du IMMER recht. Hier zuckelte gerade ein Triebwagen mit
der Aufschrift "Ostdeutsche Eisenbahn" durch Wuppertal. Ich glaubs machmal
nicht…“                                         -- Natureshadow, per SMS
„Hilf mir mal grad beim Denken“                 -- Natureshadow, IRL, 2x

Reply via email to