On Sat, Jan 24, 2009 at 08:02:57PM EST, Dan Henry wrote: > On Sat, 24 Jan 2009 19:48:06 -0500, Chris Jones <cjns1...@gmail.com> > wrote: > > >I'm trying to figure out how I can test the return value of a printf > >statement in an awk script. > > > >printf "format", variable > >if (condition==bad) {exit 1} # if printf failed, exit > > > >I have been unable to find what the "condition" in the pseudo-awk above > >might be. > > Why would it fail? stdout closed?
Nice catch. I use this in bash scripts to determine that the parent shell instance no longer exists: printf ... || exit 1 This ensures instances of the script terminate instead of crowding my ssystem with gangs of orphans when I bounce my gnu/screen sessions. > Anyway, I can't answer definitively, but am interested and thus I > suggest you ask on comp.lang.awk also. Done.