Path: utzoo!attcan!uunet!husc6!m2c!necntc!ncoast!allbery From: bsrdp@cu.warwick.ac.uk.UUCP (Mr H Boothroyd) Newsgroups: comp.sources.misc Subject: v03i070: csh prompt generator Message-ID: <11946.8807011201@sol.warwick.ac.uk> Date: 1 Jul 88 12:01:30 GMT Sender: allbery@ncoast.UUCP Reply-To: bsrdp@cu.warwick.ac.uk.UUCP (Mr H Boothroyd) Lines: 46 Approved: allbery@ncoast.UUCP Posting-number: Volume 3, Issue 70 Submitted-by: "Mr H Boothroyd"Archive-name: anotherprompt > From: jap@syssun.cl.msu.edu (Joseph A. Porkka) > Newsgroups: comp.sources.misc: Volume 3, Issue 52 > Subject: v03i052: My favorite csh prompt generator Thank you for networking the idea. It gave me something to start on to adapt for my own use here. I'm not sure whether a line for `popd' alias popd 'popd \!* && prompt' was lost in transmission or omitted by you. It is needed in addition to the three lines that arrived: > alias cd 'cd \!* && prompt' > alias prompt 'if ($?prompt) set prompt="! ${host}:${user} ${cwd}: "' > alias pushd 'pushd \!* && prompt' You may just possibly be interested in the rather heavy adaptations that I made to my .cshrc (with local help) in order to get - a prompt that leaves out my global address when in my workspace, - a full prompt when outside my workspace. I can't help feeling there ought to be easier ways, but I'm not really into unix and c. alias plocal 'expr "$cwd" : "$HOME/\(.*\)"' alias pglobal 'expr "$cwd" : "/\(.*\)"' alias prompt1 'if "$cwd" =~ "$HOME"* set prompt = "! `plocal`: " ' alias prompt2 'if "$cwd" !~ "$HOME"* set prompt = "! `pglobal`: " ' alias cd 'cd \!* && prompt1 && prompt2' alias pushd 'pushd \!* && prompt1 && prompt2' alias popd 'popd \!* && prompt1 && prompt2' cd "$cwd" ----------------------- Hylton Boothroyd Janet: h.boothroyd@uk.ac.warwick.cu Warwick Business School Darpa: h.boothroyd%cu.warwick.ac.uk@cunyvm.cuny.edu University of Warwick Uucp: h.boothroyd%sol@warwick.uucp COVENTRY Earn/Bitnet: @UKACRL England CV4 7AL Phone: +44 203 523523 Extension 2428 -----------------------