*BSD News Article 54036


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.mathworks.com!newsfeed.internetmci.com!btnet!dispatch.news.demon.net!demon!awfulhak.demon.co.uk!awfulhak.demon.co.uk!not-for-mail
From: brian@awfulhak.demon.co.uk (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: DOS Style shell prompt
Date: 30 Oct 1995 14:34:55 -0000
Organization: None
Lines: 29
Message-ID: <472nqf$6si@awfulhak.demon.co.uk>
References: <814126352.7670@kiss.demon.co.uk> <466bek$l5r@agate.berkeley.edu> <46alsh$gil@uriah.heep.sax.de> <46brjo$p1l@mark.ucdavis.edu>
X-NNTP-Posting-Host: awfulhak.demon.co.uk
X-Newsreader: TIN [version 1.2 PL2]

David E. O'Brien (obrien@cs.ucdavis.edu) wrote:
: 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

Bash also allows '\$' which expands to '$' or '#' depending on uid.

: 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)

--
Brian <brian@awfulhak.demon.co.uk>
Don't _EVER_ lose your sense of humour....