Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.wizards Subject: Re: cd failure killing script [Re: Interactive 2.2 File zapper] Message-ID: <1438@sixhub.UUCP> Date: 7 Aug 90 02:43:52 GMT References: <772@essnj1.ESSNJAY.COM> <2108@cirrusl.UUCP> <1990Aug3.022641.28848@cbnewse.att.com> <3819@auspex.auspex.com> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 20 In article <3819@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: | If you want a failed "cd" to kill the script, don't bother doing | anything. The SunOS 4.0.3 Bourne shell, based on the S5R3.1 one, will | kill the script if a "cd" fails; I checked the source code to the 4.3BSD | Bourne shell, based on the V7 one, and it appears as if it'll do the | same. Yes, only ksh gives you the choice of catching the failure. In ksh you can check status by doing something like cd $1 || break; do_more where the cd will return bad status but still continue. You learn to be VERY careful about typing "cd xxx;rm *" and other dangerous things! -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc and 80386 mailing list "Stupidity, like virtue, is its own reward" -me