Pathname in prompt, not FAQ, really.

Mumit Khan khan at THOR.XRAYLITH.WISC.EDU
Wed Jun 13 09:27:40 AEST 1990


::Namely, when I am in my home directory I want it to display a ~ 
::instead of the path of my whole directory...secondly, I would like a
::prompt which when I hit cd and return would send me $home and change
::my prompt back to ~

I usually do the following on all our machines that doesn't have TCSH,
and it works very nicely. I alias CD to the following:

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

where .prompt contains the following:
    
#! /bin/csh -f
set prompt="${USER}@${HOST} `pwd | sed 's?'${HOME}'?~?'`:\!>"

works fine for me. I don't remember what was in the FAQ sheet, so
please ignore if this has already been proposed. Having tcsh certainly
helps, but this works ok for me on our AIX and SYSV machines.

Mumit -- khan at xraylith.wisc.edu



More information about the Comp.unix.questions mailing list