Path: utzoo!utgpu!attcan!uunet!husc6!think!ames!killer!dcs!wnp
From: wnp@dcs.UUCP (Wolf N. Paul)
Newsgroups: comp.unix.questions
Subject: Re: A blank line before the unix prompt?
Keywords: prompt
Message-ID: <166@dcs.UUCP>
Date: 10 Aug 88 12:08:42 GMT
References: <3809@okstate.UUCP> <6591@bloom-beacon.MIT.EDU> <1236@ficc.UUCP>
Reply-To: wnp@dcs.UUCP (Wolf N. Paul)
Organization: DCS, Dallas, Texas
Lines: 40

In article <1236@ficc.UUCP> spenser@ficc.UUCP (spenser aden) writes:
 >In order to do this, I have to alias 'cd'.  I've tried this (and a few 
 >derivations of) in my .cshrc :  
 >
 >alias cd 'cd \!* ; set prompt="[=5h"`pwd`"[=5l \
 >(\!) " '    # set prompt string
 >
 >And I have this 'set prompt' command by itself in my .login.  The escape
 >sequence simply places the directory name in half intensity.  This works fine
 >when I first login and until I try to 'cd' to any directory, but when I try
 >to 'cd' it says 'Unmatched "."' and the 'cd' fails.  I suspect that it's not 
 >able to carry the alias over to the second line using the \ method spelled 
 >out in the previous article, but how does one get an alias definition of this
 >sort to span two lines? Sorry, I've tried to RTFM, but I can't find 'alias' in
 >the reference manual my company has provided me.

1. ALIAS is explained (not as well as it could be) in the manual entry for CSH,
   it does not have an entry of its own.

2. No, csh does not like a newline (even disguised, escaped or quoted) in an
   alias definition. Try the following:

   File ~/.setprompt:

	set prompt="\
	=5h`pwd`=5l\
	(\!) "

   Alias line in file ~/.cshrc:
   (If it is in .login, effective only for login shell; if in .cshrc,
    effective for sub-shells as well)

	
	alias cd 'cd \!* ; source ~/.setprompt'

   This method effectively REMOVES the newline from the alias definition.
-- 
Wolf N. Paul * 3387 Sam Rayburn Run * Carrollton TX 75007 * (214) 306-9101
UUCP:     killer!dcs!wnp                 ESL: 62832882
DOMAIN:   wnp%dcs@killer.dallas.tx.us    TLX: 910-380-0585 EES PLANO UD