A blank line before the unix prompt?

spenser aden spenser at ficc.UUCP
Wed Aug 10 00:35:38 AEST 1988


In article <6591 at bloom-beacon.MIT.EDU>, ilham at athena.mit.edu (Ilhamuddin Ahmed) writes:
| In article <3809 at okstate.UUCP> Ashok writes 
| >
| >My objective
| >is to print a blank line before a prompt to improve clarity of the output
| >from the previous unix command. The example follows:
| >	% ls
| >	  <output of "ls" command>
| >	% <blank line>
| >	% <now cursor is here>
| >
| >Will appreciate the response. Thanks!  -- Ashok
| 
| If you are using csh or tcsh then you can simply do this by adding the
| following in your .cshrc (or .tcshrc) or by manually typing it in 
| [Ugh :-] 
| 
| set prompt = "% \
| % "
| 
| Please note that there is no space after the '\'. This way, you can have
| multiple-line prompts.

This is interesting, and I would like to do something similar on my XENIX 386
machine, but I've got a problem.  I'd like to display the current directory
on the firrst line, and the csh history counter on the second line at the 
prompt.  Something like :

/usr2/spenser/bin
(15) _

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

(If this is hard to read, I have "<esc>[=5h" and "<esc>[=5l" around the `pwd`)
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.

-- 
S. Spenser Aden - Ferranti International Controls Corporation - PO Box 5012 
Sugar Land, TX. 77487 ------ (713)274-5000 ------ tness1!sugar!ficc!spenser  
Any opinions expressed above, unless explicitly denoted, are mine alone and 
do not reflect those of my employer.  My wife won't claim them either ...



More information about the Comp.unix.questions mailing list