Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!cbatt!ihnp4!drutx!druil!lat From: lat@druil.UUCP (TepperL) Newsgroups: net.unix Subject: Re: Korn Shell Question Message-ID: <202@druil.UUCP> Date: Thu, 30-Oct-86 10:07:37 EST Article-I.D.: druil.202 Posted: Thu Oct 30 10:07:37 1986 Date-Received: Fri, 31-Oct-86 13:48:43 EST References: <22300001@ntvax> Organization: AT&T Information Systems Labs, Denver, Co Lines: 26 Summary: Setting PS1 is easy In article <22300001@ntvax>, mike@ntvax.UUCP writes: > > I have a Korn Shell question that perhaps someone can answer. I like to > have as my system prompt my current path. When I use csh, I set up my > .cshrc file with these entries: > > set prompt = "! `pwd`}" -- this establishes my prompt as my command number > and current path when i first initiate the shell > > alias cd 'chdir \!:1; set prompt=\!\`pwd`}\' > this sets up my cd command to not only change > my working directory but to change the prompt. > > I would like to have something similar to this in ksh but I'm not sure how > to change PSx on the fly. In the version of ksh we run here, all you have to do is add to your .profile: PS1='$PWD} ' The Korn shell keeps the name of the current directory in the shell variable PWD. Also, note that you don't need to update PS1 every time you chdir. -- Larry Tepper {ihnp4 | allegra}!drutx!druil!lat +1-303-538-1759