printing from awk into the stderr

Tom Christiansen tchrist at convex.COM
Sat Feb 9 17:59:58 AEST 1991


>From the keyboard of toad at rubikon.UUCP (Peter Cleve):
:>Is it possible to "print" from awk to the stderr?
:
:The standart (and portable) solution is :
:	print "foo bar" | "cat 1>&2"
:In nawk (comes with newer unix releases) or with gawk you can try :
:	print "foo bar" > /dev/stderr

You can only do that if you the system itself supports /dev/stderr,
not awk.  And the syntax really should be:

	print "foo bar" > "/dev/stderr"

I would say there are a LOT of systems that don't support both
nawk and /dev/stderr.  But I guess it's nice if you have it.

--tom
--
 "All things are possible, but not all expedient."  (in life, UNIX, and perl)



More information about the Comp.unix.programmer mailing list