[comp.os.minix] Bugs in minix shell

condict@cs.vu.nl (Michael Condict) (10/27/89)

In 5 or 10 minutes of trying out a friend's Minix (version 1.3), I discovered
several bugs in the shell (sh).  Have these been encountered before, and does
anyone have fixes?

(1) "$@" is expanded to the single word "$1 $2 . . . $n", when it should be
    expanded to n quoted words: "$1" "$2" . . . "$n".

(2) x=`date` produces the error message "Oct: not found" (this bug is
    repeatable only during the month of October :-).   This is because the
    shell breaks the output of date into separate words.  It should treat the
    output of the command as a single word, making the assignment command
    equivalent to: x="`date`".  (The latter is handled correctly by Minix).
    Actually I prefer the Minix sh behaviour, because it is more useful to
    differentiate between "`command`" and `command`, but it differs from every
    major /bin/sh in use today.

(3) "set - a b" doesn't work, at least not when typed to an interactive shell.
    It produces no error message, but afterward, echo "$1" produces un-
    printable garbage.  (For those who don't know, "set - a b" is supposed to
    set the $1 to "a" and $2 to "b" in the shell that executes it.  This is
    useful when followed by ". file".  It allows arguments to be passed to
    the file, even though the "." command won't accept them.)

Any of the above could cause major hassles when trying to run shell scripts
from other versions of Unix on Minix.
-- 
Michael Condict		condict@cs.vu.nl
Vrije University
Amsterdam

paula@bcsaic.UUCP (Paul Allen) (11/09/89)

In article <4457@condict.cs.vu.nl> condict@cs.vu.nl (Michael Condict) writes:
>[Sorry if you've seen this before.  I posted it two weeks ago and got no
> response, so I'm assuming that recent changes in our news connection pre-
> vented it from getting out to the world.]
>
>In 5 or 10 minutes of trying out a friend's Minix system (version 1.3), I
>discovered several bugs in the shell (sh).  Have these been encountered before,
>and does anyone have fixes?
>
>(1) "$@" is expanded to the single word "$1 $2 . . . $n", when it should be
>    expanded to n quoted words: "$1" "$2" . . . "$n".
>
>(2) x=`date` produces the error message "Oct: not found" 
>[...]
>
>(3) "set - a b" doesn't work  [...]

Your original posting showed up here.  Perhaps nobody is ready to get fired up
about obscure sh bugs?  :-)

Since we're talking about the shell, how 'bout this one in 1.3d?  If I type some 
sort of a loop into the shell, I get a login: prompt when the loop terminates!  
For example:

#for n in *.c
>do
>mv $n o.$n
>done
login:

What's interesting is that the F1 display still shows my login shell running!
I'm not fired up enough to investigate this.  Is anybody looking at porting
the Bourne Again Shell to Minix?

Paul Allen

-- 
------------------------------------------------------------------------
Paul L. Allen                       | pallen@atc.boeing.com
Boeing Advanced Technology Center   | ...!uw-beaver!bcsaic!pallen