*BSD News Article 53636


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!zombie.ncsc.mil!news.duke.edu!agate!news.ucdavis.edu!not-for-mail
From: obrien@cs.ucdavis.edu (David E. O'Brien)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: DOS Style shell prompt
Date: 21 Oct 1995 22:18:32 GMT
Organization: University of California, Davis
Lines: 21
Message-ID: <46brjo$p1l@mark.ucdavis.edu>
References: <814126352.7670@kiss.demon.co.uk> <466bek$l5r@agate.berkeley.edu> <46alsh$gil@uriah.heep.sax.de>
NNTP-Posting-Host: toadflax.cs.ucdavis.edu
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]

Just wanted to get my favorate one in (bash):

if [ "$PS1" != "" ]; then	# this shell is interactive

# for PWD to use ``~'' rather than $HOME in bash use: PS1=\h:\w"> "

if [ "$EUID" = "0" ]; then
	PS1="\h(root):"'${PWD}'"> "
else
	PS1="\h:\w> "
fi
fi # interactive

for Zsh I use this:
    PS1=$HOSTNAME':%~> '


Both Bash and Zsh are available in the package section on
ftp.cdrom.com:/pub/FreeBSD

-- David    (obrien@cs.ucdavis.edu)