Path: utzoo!attcan!uunet!bu.edu!dartvax!coat.com From: andyb@coat.com (Andy Behrens) Newsgroups: comp.unix.questions Subject: Re: Exit Value from Awk Message-ID: <23227@dartvax.Dartmouth.EDU> Date: 18 Jul 90 16:26:47 GMT References: <1990Jul17.203037.22283@ccu.umanitoba.ca> <1817@hsi86.hsi.UUCP> Sender: news@dartvax.Dartmouth.EDU Lines: 17 stevens@hsi.UUCP (Richard Stevens) writes: > Gary Mills writes: >> >> Does anyone know how to set the exit code from awk within an awk >> script? > > Just say "exit ". I just tried it and it works under > V7 awk, SVR3.1 awk, nawk, and gawk. That's correct. You should be aware, though, that if you have an END{ } block, awk will execute it when it processes the "exit " statement. When the END{ } block is completed, awk will terminate with the exit code specified in the expression. Andy