Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!cit-vax!ucla-cs!zen!cory.Berkeley.EDU!schung From: schung@cory.Berkeley.EDU (Stephen the Greatest) Newsgroups: comp.unix.questions Subject: Re: csh core dump (was: if-then-else in csh alias?) Message-ID: <3571@zen.berkeley.edu> Date: Wed, 31-Dec-69 18:59:59 EDT Article-I.D.: zen.3571 Posted: Wed Dec 31 18:59:59 1969 Date-Received: Sat, 5-Sep-87 10:52:07 EDT References: <16128@teknowledge-vaxc.ARPA> <1376@bloom-beacon.MIT.EDU> <2133@umn-cs.UUCP> <1454@epimass.EPI.COM> <183@intelisc.UUCP> <3565@zen.berkeley.edu> Sender: news@zen.berkeley.edu Reply-To: schung@cory.Berkeley.EDU.UUCP (Stephen the Greatest) Organization: University of California, Berkeley Lines: 25 Keywords: csh core dump In article <3565@zen.berkeley.edu> I wrote: > >Csh bomber: > >mkdir x x/y >set home = x/y >cd x/y <==== Typo >cd ../.. >*** BOOM! *** >core dumped > Oh, my mistake. It should be a mere 'cd' that goes to $home instead of 'cd x/y'. :-( After the command 'cd', the working directory will be set to $home which is x/y. The *shell variable* 'cwd' is also set to $home, which is x/y. Note that the string in cwd is not a full directory path, so when you do a cd .., it first goes up one directory and sets cwd to x. The next cd .. you do, it goes up yet another directory and tries to set cwd right...... Oops! BOOM! The variable becomes undefined because it was not a full path to begin with! Therefore, to prevent such a core-dump, do not set home to something other than a full path. - Stephen