Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site elsie.UUCP Path: utzoo!linus!vaxine!wjh12!harvard!seismo!rlgvax!cvl!elsie!ado From: ado@elsie.UUCP Newsgroups: net.unix-wizards Subject: 4.1bsd csh startup enhancement Message-ID: <985@elsie.UUCP> Date: Fri, 29-Jun-84 14:41:23 EDT Article-I.D.: elsie.985 Posted: Fri Jun 29 14:41:23 1984 Date-Received: Tue, 10-Jul-84 04:21:01 EDT Organization: NIH-LEC, Bethesda, MD Lines: 57 Here's some code from 4.1bsd's "csh/sh.c": srccat(value("home"), "/.cshrc"); if (!fast && !arginp && !onelflg) dohash(); if (loginsh) { int ldisc; srccat(value("home"), "/.login"); } The first "srccat" call is what's responsible for reading your ".cshrc" file; the second is what reads your ".login" file when appropriate. The "dohash" call between them is designed to get "search path hashing" done. Now if your ".cshrc" file contains a "set path" command, then "search path hashing" is done when that command is executed, making the "dohash" above redundant. Of course, if your ".cshrc" file is "set path"-free, you DO want to do the above "dohash". There's a variable in "sh.exec.c" with the name "havhash" which tells whether hashing has been done. So, if you change the above lines to: srccat(value("home"), "/.cshrc"); if (!fast && !arginp && !onelflg) #ifdef OLDVERSION dohash(); #else { extern int havhash; if (!havhash) dohash(); } #endif if (loginsh) { int ldisc; srccat(value("home"), "/.login"); } you can avoid redundant hash table building. If your a purist, then while you're in the neighborhood you might want to make this change also: if (loginsh) { #ifdef OLDVERSION int ldisc; #else /* Is "lint" no joy? Is joy no linter? */ #endif srccat(value("home"), "/.login"); } -- ...decvax!allegra!umcp-cs!elsie!ado (301) 496-5688 (the DEC and VAX in decvax are Digital Equipment Corporation trademarks)