Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!cheops!logier From: logier@cheops.qld.tne.oz.au (Rob Logie) Newsgroups: comp.unix.shell Subject: Re: Current directory in the ksh prompt? Message-ID: <1991Apr28.234727.15490@cheops.qld.tne.oz.au> Date: 28 Apr 91 23:47:27 GMT References: Organization: Telecom Australia, TNE Computer Support Services Lines: 38 mju@mudos.ann-arbor.mi.us (Marc Unangst) writes: >I realize this is probably a FAQ, but I can't seem to find the FAQ >list on this machine or any of the NNTP servers around here (if you >know of an NNTP server that accepts connections from anybody and keeps >news a long time, like for over two weeks, please let me know!), so >I'll ask away... >I recently started using ksh, and one thing I miss dearly from csh is >the ability to put the current directory in your prompt. With csh, it >can be done by aliasing the cd command to something that does the cd >and then re-sets your prompt, using `pwd` to get the new directory. >Unfortunately, it seems that you can't use the parameters inside an >alias like you can in csh, so this trick doesn't work. Is there a >different trick for ksh, or am I just going to have to live with >typing "pwd" all the time? >-- >Marc Unangst | >mju@mudos.ann-arbor.mi.us | "Bus error: passengers dumped" >...!hela!mudos!mju | Try PS1="`id -un`@`hostname`:"'$PWD'" $ "; export PS1 You will have to customise the id and hostname commands to what ever you machine uses to return current user id and hostname. -- Rob Logie EMAIL: logier@cheops.qld.tne.oz.au Telecom Australia FAX: +61 7 837 4704 TNE Computer Support Services PH: +61 7 837 5174 Brisbane Office "These are my opinions alone"