How can I do that?
/Kenneth
On systems that have /dev/stderr or where awk fakes /dev/stderr,
you can do:
print "foo" > "/dev/stderr"
Otherwise, you can do:
system("echo foo >&2")
or
print "foo" | "cat >&2"
--
Stéphane
To STDOUT or STDERR?
With GNU awk (and probably others), to print to stdout, just redirect
to /dev/stdout. To print to stderr, redirect to /dev/stderr.
man awk
--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
> I have a file, that is parsed through AWK. I would like a few run-time
> > comments to be printed to STDERR while processing within AWK.
>
> [...]
>
> On systems that have /dev/stderr or where awk fakes /dev/stderr,
> you can do:
>
> print "foo" > "/dev/stderr"
Thanks. Both of you.
/Kenneth