9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Rc redirect woes
@ 2015-08-04 12:40 dexen deVries
  0 siblings, 0 replies; only message in thread
From: dexen deVries @ 2015-08-04 12:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs, plan9port-dev

[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]

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

--

---
You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 1436 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-04 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-04 12:40 Rc redirect woes dexen deVries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).