cd failure killing script [Re: Interactive 2.2 File zapper]

Larry Wall lwall at jpl-devvax.JPL.NASA.GOV
Sun Aug 12 05:10:53 AEST 1990


In article <26C2F1A0.205B at tct.uucp> chip at tct.uucp (Chip Salzenberg) writes:
: According to davidsen at 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 at jpl-devvax.jpl.nasa.gov



More information about the Comp.unix.wizards mailing list