From owner-freebsd-questions Fri Oct 26 3:37:52 2001 Delivered-To: freebsd-questions@freebsd.org Received: from new-smtp2.ihug.com.au (new-smtp2.ihug.com.au [203.109.250.28]) by hub.freebsd.org (Postfix) with ESMTP id 181DC37B405 for ; Fri, 26 Oct 2001 03:37:48 -0700 (PDT) Received: from motha (p437-tnt1.syd.ihug.com.au [203.173.129.183]) by new-smtp2.ihug.com.au (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id UAA29127; Fri, 26 Oct 2001 20:37:37 +1000 From: syncman@ihug.com.au X-Authentication-Warning: new-smtp2.ihug.com.au: Host p437-tnt1.syd.ihug.com.au [203.173.129.183] claimed to be motha To: Kelvin Ng Chee Hoong Date: Fri, 26 Oct 2001 20:34:56 +1000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Change Prompt Cc: questions@freebsd.org Message-ID: <3BD9C8F0.9313.25CFA56@localhost> In-reply-to: <5.1.0.14.0.20011026173002.00a44de0@po.pacific.net.sg> X-mailer: Pegasus Mail for Win32 (v3.12c) 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 > Hi ; > I use bash shell in my FreeBSD machine . How do I change a promt from > "$" to "#" when I login as superuser from normal user to root ? > > > my .bashrc script looks as following ..... > > PS1="[\u@\h: \w]\$ " > alias ls='ls -F' > alias cp='cp -i' > alias mv='mv -i' > alias rm='rm -i > > > Another question , what is the function of PS2 and when to use it ? Please > advise .... Hi Kelvin, Bash automatically expands "\$" in PS{1,2} to "#" for user ID 0 and "$" for any other user ID. PS2 is used when additional input is needed from the user, such as in the following example: syncman@viper ~$ echo PS2=\'$PS2\' PS2='> ' syncman@viper ~$ for x in hello world > do echo $x > done hello world syncman@viper ~$ See the PROMPTING section in the bash(1) manual page for more information. - Syncman. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message