Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!fluke!strong From: strong@tc.fluke.COM (Norm Strong) Newsgroups: comp.unix.questions Subject: Re: current pwd in prompt Message-ID: <2896@fluke.COM> Date: 16 Feb 88 21:15:30 GMT References: <11656@brl-adm.ARPA> <253@icus.UUCP> <1981@ho95e.ATT.COM> Sender: news@tc.fluke.COM Organization: John Fluke Mfg. Co., Inc., Everett, WA Lines: 23 In article <1981@ho95e.ATT.COM> wcs@ho95e.UUCP (46323-Bill.Stewart,2G218,x0705,) writes: >:In article <11656@brl-adm.ARPA> Mensing.HENR801c@Xerox.COM writes: >:|>Can anyone explain to me how to get my prompt to be the current directory? I >:|>have tried several methods without any success. It seems that no matter what >:|>method I try, the prompt is evaluated once and never changes. If you use the c-shell, you can do it the way I do: alias cd 'chdir \!*; set prompt= "^[[7m $cwd:t ^[[0m> "; ls -aF' Put this line in your .cshrc file and the set prompt command in your .login file. Every time you change directories the prompt will follow. It is not foolproof since it will not work if you use the chdir command to change directories. Incidentally the garbage around the $cwd:t is to direct my VT-100 to use reverse video and can be eliminated if a simple prompt is adequate. -- Norm (strong@tc.fluke.com)