Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!munnari.oz.au!bruce!goanna!minyos.xx.rmit.oz.au!s902113 From: s902113@minyos.xx.rmit.oz.au (Luke Mewburn) Newsgroups: comp.unix.wizards Subject: Re: pwd prompts in unix Message-ID: <1991Jun24.014352.3760@minyos.xx.rmit.oz.au> Date: 24 Jun 91 01:43:52 GMT Article-I.D.: minyos.1991Jun24.014352.3760 References: <27275@adm.brl.mil> Organization: RMIT Computer Centre, Melbourne Australia. Lines: 41 ketell@tolkien (Gregory Ketell) writes: >How you set up your prompt depends on what shell you are running. Here are >some methods I use. >CSH: > Create two aliases in your .cshrc file > alias cd 'cd \!*;promp' > alias promp 'set prompt = "`hostname`:`pwd` ! > "' > This will result in a prompt such as tolkien:/usr/bin 23 > > which tells you which machine you are currently on, your path, and > what history command you are on. Doing the following will give you the path as an index to your home (if it can), so instead of: minyos [/u1/s90/s902113/bin] 58: we get minyos [~s902113/bin] 58: Also, support for pushd & popd is provided... (NB: I didn't write the set_prompt [well, the 'sed' bit anyway], I just reconfigured it for my preferences of hostname & history index placing) alias set_prompt 'set prompt="$host"" [`dirs|sed -e '\''s| .*||'\''`] \\!: "' alias cd 'cd \!*; set_prompt' alias push 'pushd \!*; set_prompt' alias pop 'popd; set_prompt' >KSH: > The Korn Shell has support for that built in. All you do is set > your prompt command in your .profile to something like > PS1 $HOST:$PWD ! > > export PS1 > and it will give you the same results as above. > (Please excuse me if this is not perfect. I have not been on > the Korn Shell for quite some time.) >Good Luck, >Gregory G. Ketell >Director of Systems Engineering >Rimma Technologies, Inc. >gketell@seq.csuhayward.edu