Path: utzoo!attcan!uunet!mcsun!ukc!slxsys!ibmpcug!miclon!nreadwin From: nreadwin@miclon.uucp (Neil Readwin) Newsgroups: comp.unix.questions Subject: Re: Exit Value from Awk Message-ID: <1990Jul19.175312.19565@miclon.uucp> Date: 19 Jul 90 17:53:12 GMT References: <1990Jul17.203037.22283@ccu.umanitoba.ca> Organization: Micrognosis, London, UK Lines: 17 In article <1990Jul17.203037.22283@ccu.umanitoba.ca> mills@ccu.umanitoba.ca (Gary Mills) writes: >Does anyone know how to set the exit code from awk within an awk >script? My AT&T and Sun manuals are silent on this. I want to >be able to do: `awk -f file file || cat file'. According to an old posting from jwp%chem@sdcsvax.ucsd.edu # The user manual says that using the exit function causes the script to # behave as if end-of-input has been reached. Not mentioned explicitly # is the fact that this will cause the END block to be executed if it # exists. Also, two things are omitted: # # exit(expr) causes the script's exit status to be set to the value of expr. # # If exit is called within the END block, the script exits immediately. -- Disclaimer: 818 Phone: +44 71 528 8282 E-mail: nreadwin@micrognosis.co.uk