A blank line before the unix prompt?

Wolf N. Paul wnp at dcs.UUCP
Wed Aug 10 22:08:42 AEST 1988


In article <1236 at ficc.UUCP> spenser at 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 at killer.dallas.tx.us    TLX: 910-380-0585 EES PLANO UD



More information about the Comp.unix.questions mailing list