Path: utzoo!attcan!uunet!bu.edu!snorkelwacker!apple!vsi1!wyse!bob From: bob@wyse.wyse.com (Bob McGowen x4312 dept208) Newsgroups: comp.unix.questions Subject: Re: Exit Value from Awk Message-ID: <2794@wyse.wyse.com> Date: 18 Jul 90 16:08:10 GMT References: <1990Jul17.203037.22283@ccu.umanitoba.ca> Sender: news@wyse.wyse.com Reply-To: bob@wyse.UUCP (Bob McGowen x4312 dept208) Organization: Wyse Technology Lines: 23 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'. >-- >-Gary Mills- -University of Manitoba- -Winnipeg- Use the `exit' function: awk '{ # your code if (some_condition) exit 0 else exit 1 }' ... Cheers- :-) Bob McGowan (standard disclaimer, these are my own ...) Product Support, Wyse Technology, San Jose, CA ..!uunet!wyse!bob bob@wyse.com