home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!pipex!mfmail!dnh
- From: dnh@mfltd.co.uk (Des Herriott)
- Subject: Re: ksh prompt
- Message-ID: <1993Jan22.120028.18986@mfltd.co.uk>
- Sender: dnh@mfltd.co.uk (Des Herriott)
- Organization: Micro Focus Ltd., Newbury, UK
- References: <C17DJ4.FoA@sdf.lonestar.org>
- Date: Fri, 22 Jan 1993 12:00:28 GMT
- Lines: 25
-
-
- In article <C17DJ4.FoA@sdf.lonestar.org>, larry@sdf.lonestar.org (Larry D. Clark) writes:
- >
- > I am using ksh on a platform running Unix 5.4 at work and would
- > like to have my PS1 to reflect the current working directory.
- > Does any one have any ideas how to do it??
-
- Probably the best way of doing it is to write a function:
-
- function _cd
- {
- \cd "$@" || return
- PS1="`basename $PWD` $ " # or something to that effect
- }
-
- alias cd=_cd
-
- Then just stick that lot in your .profile or .kshrc.
-
- Des.
- --
- Des Herriott, / "...and I hate, and I hate, and I hate,
- Micro Focus, Newbury. / elevator music..."
- +44 (0635) 565354 /
- dnh@mfltd.co.uk / -- Tori Amos, Little Earthquakes.
-