Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gitpyr.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!gatech!gitpyr!robert From: robert@gitpyr.UUCP (Robert Viduya) Newsgroups: net.unix-wizards Subject: Re: ksh PS1 Message-ID: <224@gitpyr.UUCP> Date: Sun, 17-Mar-85 08:31:18 EST Article-I.D.: gitpyr.224 Posted: Sun Mar 17 08:31:18 1985 Date-Received: Mon, 18-Mar-85 07:48:00 EST References: <244@rruxe.UUCP> Organization: Georgia Tech, Atlanta Lines: 26 >< Posted from jpage@rruxe.UUCP (J. H. Page) > any unix-wizards out in net.land know how to have one's UNIX prompt change > to reflect a change in one's working directory. > > i have access to sh and ksh on our system. > The trick here is to make the cd/chdir command change your prompt whenever it's invoked. I dunno about ksh, but SysVR2 sh won't let you and still be able to retain the same name for the cd command. The problem lies in the fact that shell-builtins are searched first, then user-functions, then $PATH. This means there's no way to intercept-and-redefine the cd command. Csh will let you because aliases are expanded before shell-builtins and path. It is possible, however, if you call your cd command something other than 'cd'. This command would call cd to change your directory and then set your prompt to the new directory. robert -- Robert Viduya Georgia Institute of Technology ...!{akgua,allegra,amd,hplabs,ihnp4,masscomp,ut-ngp}!gatech!gitpyr!robert ...!{rlgvax,sb1,uf-cgrl,unmvax,ut-sally}!gatech!gitpyr!robert