[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Interactive $PWD in prompt using /bin/sh ?
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Re: Interactive $PWD in prompt using /bin/sh ?
- From: Matthias Kilian <kili_(_at_)_outback_(_dot_)_escape_(_dot_)_de>
- Date: Mon, 23 Aug 2004 18:35:57 +0200
- Mail-followup-to: misc_(_at_)_openbsd_(_dot_)_org
On Mon, Aug 23, 2004 at 04:33:54PM +0100, Matthew Law wrote:
> I'm using the bourne shell as default for my user account on OpenBSD 3.5
> and I'd like the prompt to track the current $PWD.
I recommend to use /bin/ksh and set PS1 to something like
PS1="[${LOGNAME}_(_at_)_$(hostname -1):\${PWD}]$ "
or something like
PS1="[${LOGNAME}_(_at_)_$(hostname -1):\$(basename \${PWD})]$ "
for a shorter prompt.
With ksh, you can use parameter, command and arithmetic substitutions
in PS1. For more info, see ksh(1).
Ciao,
Kili
Visit your host, monkey.org