home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!wupost!swbatl!texbell!swuts!jc8922
- From: jc8922@swuts.sbc.com (Jeff Conner)
- Newsgroups: comp.unix.shell
- Subject: Re: ksh prompt (PS1) and cd
- Message-ID: <1386@swuts.sbc.com>
- Date: 29 Jul 92 17:26:08 GMT
- References: <l5n3efINN3g7@exodus.Eng.Sun.COM> <1992Jul21.132016.19391@cbnewsi.cb.att.com>
- Distribution: ba
- Organization: Southwestern Bell Telephone Company
- Lines: 23
-
- >"
- >"Using ksh, how can one alias "cd" to change directory as well as
- >"to set PS1 to $PWD.
- >"
- >"I tried:
- >"alias cd="cd; PS1=$PWD"
- >"but didn't work.
- >
-
- PS1='$PWD $ ' export PS1
-
- This will give you the current PATH in your prompt everytime you 'cd'.
- e.g.,
- /usr $ echo $PATH # current directory is /usr
- /usr
- /usr $ cd bin
- /usr/bin $ # notice prompt has changed
-
- --
- Jeff Conner 314-235-0274 | uunet!swuts!jc8922
- Southwestern Bell Telephone | -or- jc8922@swuts.sbc.com
- One Bell Center 23-K-07 |
- St. Louis, Missouri 63101-3099 |
-