bug in plan9port rc(1):
straightforward mix of input and output redirects inside of a block (`for'
loop, `if' clase) causes subsequent commands' stdout to be errorously
redirected too.
the trigger is one or more input redirects (<{COMMAND}).
problem disappears once executions falls outside of the block.

#!/usr/bin/env rc

if (true) {
    echo bah blah blah > /dev/null
    echo AAA works just fine
    cat <{echo aaa} > /tmp/junk-if.txt
    echo this gets redirected errorously
    echo this gets redirected errorously
}

for (i in 1 2 3) {
    echo bah blah blah > /dev/null
    echo AAA works just fine
    cat <{echo aaa} > /tmp/junk-for.txt
    echo this gets redirected errorously
    echo this gets redirected errorously
}

echo ZZZ works just fine

Reply via email to