🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1713

Re: gawk's exit # statement doesn't work

#1713
From: David Trueman
Date: Fri, 02 Feb 1990 14:47
19 lines
929 bytes
> Gawk exits with a zero `status' even with statements like "exit 1"
> 
> > ai% gawk -V '{exit 2}' < /dev/null
> > Gnu Awk (gawk) 2.11, patchlevel 1
> > ai% echo $status
> > 0
> > ai%
> 
> Jim Meyering      meyering@cs.utexas.edu

In this case, since no input records are read, the action is never
executed and thus the exit status is not set.  Giving the
program some input will set the exit status, as will the program:

BEGIN { exit 2 }

or

END { exit 2 }
Technical Details
Message-ID: <9002021547.AA15271@cs.dal.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!cs.dal.ca!david
References: <9002011730.AA25762@ai.cs.utexas.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!cs.dal.ca!david
From: david@cs.dal.ca (David Trueman)
Newsgroups: gnu.utils.bug
Subject: Re: gawk's exit # statement doesn't work
Message-ID: <9002021547.AA15271@cs.dal.ca>
Date: 2 Feb 90 14:47:40 GMT
References: <9002011730.AA25762@ai.cs.utexas.edu>
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 19