Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!aicchi!ignatz From: ignatz@aicchi.UUCP (Ihnat) Newsgroups: net.unix,net.unix-wizards Subject: Re: question-- Bourne (and C) SHELL Message-ID: <791@aicchi.UUCP> Date: Fri, 22-Aug-86 03:48:07 EDT Article-I.D.: aicchi.791 Posted: Fri Aug 22 03:48:07 1986 Date-Received: Sat, 23-Aug-86 11:07:34 EDT References: <1751@ittatc.ATC.ITT.UUCP> <7028@utzoo.UUCP> <150@humming.UUCP> <6228@sun.uucp> Reply-To: ignatz@aicchi.UUCP (Ihnat) Organization: Analysts International Corp; Chicago Branch Lines: 24 Summary: NOT of a retcode in Bourne shell Xref: mnetor net.unix:5268 net.unix-wizards:7664 There may be more elegant ways--it's sometimes tough to be elegant at 2:50 AM--but certainly, for filename FILE ls FILE >/dev/null 2>/dev/null if [ ! $? ] then fi; works. (As we all know, $? is the return code from the last executed command.) However, if just testing existence, how about if [ -f FILE ] then fi; Look at test(1); it's got a lot of nifty cases you can test... -- Dave Ihnat Analysts International Corporation (312) 882-4673 ihnp4!aicchi!ignatz || ihnp4!homebru!ignatz