🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1707

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

#1707
From: Arnold Robbins
Date: Fri, 02 Feb 1990 17:19
20 lines
1210 bytes
In article <9002011730.AA25762@ai.cs.utexas.edu> meyering@CS.UTEXAS.EDU (Jim Meyering) writes:
>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

Not so.  This statement is *never* executed, as EOF happens right away.
If you type

	echo hi | gawk '{exit 2}'

then it will indeed exit with a status of 2.  I just checked.
-- 
Arnold Robbins -- Senior Research Scientist - AudioFAX | Laundry increases
2000 Powers Ferry Road, #220 / Marietta, GA. 30067     | exponentially in the
INTERNET: arnold@audiofax.com	Phone: +1 404 933 7600 | number of children.
UUCP:	  emory!audfax!arnold	Fax:   +1 404 933 7606 |   -- Miriam Hartholz
Technical Details
Message-ID: <200@audfax.audiofax.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!emory!audfax!arnold
References: <9002011730.AA25762@ai.cs.utexas.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!emory!audfax!arnold
From: arnold@audiofax.com (Arnold Robbins)
Newsgroups: gnu.utils.bug
Subject: Re: gawk's exit # statement doesn't work
Message-ID: <200@audfax.audiofax.com>
Date: 2 Feb 90 17:19:23 GMT
References: <9002011730.AA25762@ai.cs.utexas.edu>
Distribution: gnu
Organization: AudioFAX Inc., Atlanta
Lines: 20