From plank@cs.utk.edu Wed Jun 11 13:54:30 1997 Subject: Re: Indirection, pipes >To: plank@cs.utk.edu >Subject: Indirection, pipes > > This is what I tried from UNIX> > cd \bin > sh > cd > cat < f1 > This is f1. > cat f1 f3 > f2 > cat: f3: No such file or directory > cat f1 f3 2> f2 > f2: File exists. > cat f1 f3 2>&1 > f2 > Ambiguous output redirect. > cat f1 f3 > f2 2>&1 > Ambiguous output redirect. > cat f1 f3 >&2 2> f2 > Ambiguous output redirect. > cat f1 f3 2> f2 >&2 > Ambiguous output redirect. > cat f1 f3 2>&1 >f2 | cat > f5 > Ambiguous output redirect. > This was from my home directory. Also, I'm on pebbles and not on >a hydra machine. I don't know if that makes a difference. Anyway, >is the above sequence correct? No. You're not running the Bourne shell. This is what you should see: UNIX> /bin/sh $ cat < f1 This is f1 $ cat f1 f3 > f2 cat: f3: No such file or directory $ cat f1 f3 2> f2 This is f1 $ cat f1 f3 2>&1 > f2 cat: f3: No such file or directory $ cat f1 f3 > f2 2>&1 $ cat f1 f3 >&2 2> f2 This is f1 $ cat f1 f3 2> f2 >&2 $ cat f1 f3 2>&1 >f2 | cat > f5 You should check f2 after each command to see what it contains, and then figure out why it contains what it does.