help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gawk: catching print|command failures?


From: Ian D.
Subject: gawk: catching print|command failures?
Date: 7 Jul 2004 07:39:24 -0700

If you have a line like
    print "hello" | "/bin/some/program/that/bombs"
then you get a broken pipe message and gawk exits.  For example:
    $ gawk '{print | "foo(bar)"}'
    hey
    sh: syntax error at line 1: `foo' unexpected
    Broken Pipe
    $

Is there a way to "catch" the error within gawk and continue running? 
I don't want gawk to exit.

TIA,
Ian


reply via email to

[Prev in Thread] Current Thread [Next in Thread]