Re^2: a.out 1> file.out 2> file.err in csh?
Steve Dempsey
dempsey at handel.colostate.edu.
Sat Oct 29 12:16:53 AEST 1988
In article <7132 at cslb.CSL.SRI.COM> aida at csl.sri.com (Hitoshi Aida) writes:
>Also, is there any good way to send message to stderr in csh?
>I mean just like
> echo "$1 not found" >&2
>in sh.
Not that I know of. But if it's an interactive script, use
echo "whatever" >> /dev/tty
Otherwise, I use a little C program like this:
------------------------------------------------------------
/* stderr.c : direct stdin to stderr */
/* off the top of my head; did not compile & run this */
#include<stdio.h>
main() {
register char c;
while((c=getchar())!=EOF)
putc(c,stderr);
}
------------------------------------------------------------
Then the shell part says
echo "whatever" | stderr
If anyone knows how to do this cleanly within csh, I too would like
to know.
>Hitoshi AIDA
>Computer Science Lab, SRI International
/\ \Steve Dempsey, Center For \steved at longs.LANCE.ColoState.Edu
\/ _|/ _ _\Computer Assisted Engineering\dempsey at handel.CS.ColoState.Edu
/\ | (_) | |_(_)\Colorado State University \...!ncar!handel!dempsey
/_/_/(_/\_/ V \_ \Fort Collins, CO 80523 \(303)-491-0630
More information about the Comp.unix.wizards
mailing list