From owner-freebsd-questions Wed Jan 2 20: 5:42 2002 Delivered-To: freebsd-questions@freebsd.org Received: from fedde.littleton.co.us (cfedde.dsl.frii.net [216.17.139.141]) by hub.freebsd.org (Postfix) with ESMTP id D4FB737B405 for ; Wed, 2 Jan 2002 20:05:38 -0800 (PST) Received: from fedde.littleton.co.us (localhost [127.0.0.1]) by fedde.littleton.co.us (8.11.6/8.11.4) with ESMTP id g0345Zx30208; Wed, 2 Jan 2002 21:05:35 -0700 (MST) Message-Id: <200201030405.g0345Zx30208@fedde.littleton.co.us> To: "J.S." Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Shell prompt contest In-Reply-To: <20020102150618.04ae22ff.johann@broadpark.no> From: Chris Fedde Date: Wed, 02 Jan 2002 21:05:35 -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 2 Jan 2002 15:06:18 +0100 "J.S." wrote: +------------------ | Let's see who has the prettiest one :-) | | -- LET THE GAMES BEGIN! +------------------ It's not the prettiest thing around but it has some useful features for me. case `uname` in BSD/OS | FreeBSD | Linux) host=`hostname` PS1="$host $ " ;; HP-UX | SunOS) host=$(hostname) PS1=${host%%.*}' ${PWD##*/} $ ' ;; esac case $SHELL in *bash) if expr X$TERM : Xxterm then PS1='\[^[[1m\]\$ \t \u@$host:\w\[^[[0m\]\n' PS1="\[^[]0;$host^G\]$PS1" fi ;; esac This generates a prompt that looks as follows. $ 20:53:07 cfedde@boing.fedde.littleton.co.us:~ Yes there is a carrage return in it. And nothing on the "typing line". It uses bold text in an xterm and it updates the window title with the current host name. The user@host:directory format provides ample cut and paste fodder for scp, ftp, emails and the like. The time stamp lets me keep track of how long some commands take. -- Chris Fedde To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message