Date: Wed, 18 May 2005 17:51:03 -0400 From: Gerard Seibert <gerard-seibert@suscom.net> To: freebsd-questions@freebsd.org Subject: Re: Bash: Setting Prompt Message-ID: <20050518175043.D57A.GERARD-SEIBERT@suscom.net>
next in thread | raw e-mail | index | archive | help
=1EOn Wed, 18 May 2005 07:37:44 -0500 Jacob S <stormspotter@6Texans.net> wrote: $> $>On Wed, 18 May 2005 06:26:53 -0400 (Eastern Standard Time) $>Gerard Seibert <gerard-seibert@rcn.com> wrote: $> $>> FreeBSD 5.4 and Bash 3.00.16(1) $>>=20 $>> I hope that this is the right place to post this. $>>=20 $>> I have the following in my '.bash_profile' file. $>> # $>> # Set the prompt to display the 'user@host' and the working=20 $>> # directory with a '#' for root and '$' for user. $>> # $>> PS1=3D"\u@\h \w " $>> case 'id -u' in $>> 0) PS1=3D"${PS1}# ";; $>> *) PS1=3D"${PS1}$ ";; $>> esac $>> # $>> # Keep the environment when using su to become root $>> # $>> alias su=3D'su -m' $>> # $>> It is suppose to set the prompt to display the 'user@host' and the $>> working directory with a '#' for root and '$' for user. Everything $>> works except for the '#' and '$' symbols. The '$' symbol is always $>> displayed. $>>=20 $>> I must be doing something really stupid, but I do not know what. I $>> hope that someone can assist me. $> $>Just a guess, as I haven't tested this, but try changing your case line $>to look like this: $> $>case `id -u` in (Note the backticks instead of apostrophes.) $> $>HTH, $>Jacob ********** Reply Separator ********** Wednesday, May 18, 2005 5:48:39 PM I was not aware that there was a difference. Thanks, I will give it a shot. Ciao
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050518175043.D57A.GERARD-SEIBERT>