Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.unix.wizards Subject: Re: cd failure killing script [Re: Interactive 2.2 File zapper] Message-ID: <9118@jpl-devvax.JPL.NASA.GOV> Date: 11 Aug 90 19:10:53 GMT References: <1990Aug3.022641.28848@cbnewse.att.com> <3819@auspex.auspex.com> <1438@sixhub.UUCP> <26C2F1A0.205B@tct.uucp> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 12 In article <26C2F1A0.205B@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: : According to davidsen@sixhub.UUCP (bill davidsen): : >Yes, only ksh gives you the choice of catching the failure. : : Bash 1.05 also continues after a "cd" failure. Likewise Perl. The idiom to catch the failure is chdir $dir || die "Can't cd to $dir: $!\n"; Larry Wall lwall@jpl-devvax.jpl.nasa.gov