Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcdchg!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.wizards Subject: Re: cd failure killing script [Re: Interactive 2.2 File zapper] Message-ID: <1990Aug13.211716.5111@chinet.chi.il.us> Date: 13 Aug 90 21:17:16 GMT References: <1438@sixhub.UUCP> <26C2F1A0.205B@tct.uucp> <9118@jpl-devvax.JPL.NASA.GOV> Organization: Chinet - Public Access UNIX Lines: 19 In article <9118@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >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"; This is reasonable behaviour for perl since it doesn't claim any compatibility with /bin/sh scripts. Those other two mentioned above will cause serious problems when executing scripts that are perfectly valid for /bin/sh. They could (should) have required a "set" option to be done to make them operate differently. Les Mikesell les@chinet.chi.il.us