home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!highlite!dlreed
- From: dlreed@highlite.uucp (David L. Reed)
- Subject: Re: ksh prompt
- Message-ID: <1993Jan24.163848.15700@highlite.uucp>
- Organization: Gotham Communications Research
- References: <C17DJ4.FoA@sdf.lonestar.org> <1993Jan22.120028.18986@mfltd.co.uk>
- Date: Sun, 24 Jan 1993 16:38:48 GMT
- Lines: 45
-
- dnh@mfltd.co.uk (Des Herriott) writes:
-
-
- >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.
-
- Sorry but this seems very redundant to me. Just set PS1 and export
- like this in your .profile:
-
- PS1=`$PWD $ `
- export PS1
-
- Then your prompt will always contain your current directory followed
- by whatever you set with it--in this case:
-
- /usr/home/you $
-
-
-
- >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.
- --
- David L. Reed: dlreed@gotham.com dlreed@highlite.uucp uunet!highlite!dlreed
- Come join us at highlite... Public Access Unix for DC/MD/VA.
- D.C. Metro (301)924-5998, Comms set to 8N1. login: guest passwd: guest
- Taking calls at 1200/2400/9600+ (V.32bis/V.42bis w/error correction)
-