printing from awk into the stderr

David Trueman david at cs.dal.ca
Sun Feb 10 12:24:01 AEST 1991


In article <1991Feb09.065958.22874 at convex.com> tchrist at convex.COM (Tom Christiansen) writes:
|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,

Gawk fakes the support.

|not awk.  And the syntax really should be:
|
|	print "foo bar" > "/dev/stderr"

Right.
-- 
{uunet watmath}!dalcs!david  or  david at cs.dal.ca



More information about the Comp.unix.programmer mailing list