Make & .cshrc

Wayne Mesard mesard at bbn.com
Tue Sep 13 06:56:39 AEST 1988


>From article <21621 at tut.cis.ohio-state.edu>, by karl at triceratops.cis.ohio-state.edu (Karl Kleinpaste):
> You should set prompt
> iff there already exists a prompt, i.e.,
> 	if ($?prompt) then
> 		alias cd 'chdir \!*; set prompt="$cwd> "'
> 	endif
> 
> Otherwise, you're unconditionally introducing a prompt into a context
> where none should exist.  (And didn't exist, since csh knew whether it
> was running interactively from a tty, and sets prompt only if so.)

Or more generally, put the following line at the top of your .cshrc
file:

    if ($?prompt == 0) exit

Since most users only need the stuff in .cshrc when they'll be typing to
the shell.  This speeds up programs which might invoke csh (such as
make(1)) as well as dain bramaged shell C-shell scripts which don't have
the -f option in their first line.

-- 
void *Wayne_Mesard();         MESARD at BBN.COM         BBN, Cambridge, MA



More information about the Comp.unix.wizards mailing list