9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.62k stars 320 forks source link

mk ignores MKSHELL environment variable #524

Open rminnich opened 2 years ago

rminnich commented 2 years ago

IIUC mk should use the MKSHELL from the environment to determine behavior.

rminnich@a300:~/plan9port/src/cmd/mk$ cat /tmp/m.test
use-rc:V:
    for(i in a b c)
        echo $i

rminnich@a300:~/plan9port/src/cmd/mk$ export MKSHELL=`which rc`
rminnich@a300:~/plan9port/src/cmd/mk$ echo $MKSHELL 
/home/rminnich/plan9port/bin/rc
rminnich@a300:~/plan9port/src/cmd/mk$ mk -f /tmp/m.test
for(i in a b c)
    echo $i
sh: 1: Syntax error: Bad for loop variable
mk: for(i in a ...  : exit status=exit(2)

If I set MKSHELL in the file it works, but I need it to use the environment variable ... is this WAI or a bug?