From owner-freebsd-questions Tue Dec 8 11:47:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA02170 for freebsd-questions-outgoing; Tue, 8 Dec 1998 11:47:23 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from finsco.com (ns1.finsco.com [205.241.191.2]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id LAA02164 for ; Tue, 8 Dec 1998 11:47:21 -0800 (PST) (envelope-from billh@finsco.com) Received: from finsco.com by finsco.com (SMI-8.6/SMI-SVR4) id NAA24627; Tue, 8 Dec 1998 13:45:13 -0600 Message-ID: <366D825B.1C4A3051@finsco.com> Date: Tue, 08 Dec 1998 13:47:39 -0600 From: Bill Hamilton X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Markus CC: freebsd-questions@FreeBSD.ORG Subject: Re: prompt2 References: <366C3D88.7C67F93E@ucsd.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG If you use the korn shell (ksh), you can put the following function into your .env file. It works for all 3 formats of cd. Note that PS0 ... PS4 are standard. PSH is one I made up. PS0='!: ' PSH=$(hostname) # function to change directories and reset prompt ......................... function _cd { if (($#==0)) then 'cd' PS1="$PSH:$PWD>" fi if (($#==1)) then 'cd' $1 PS1="$PSH:$PWD>" fi if (($#==2)) then 'cd' $1 $2 PS1="$PSH:$PWD>" fi } # alias cd to be the _cd function alias -x cd=_cd # export the _cd function typeset -fx _cd To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message