/* HINT: Search archives @ http://www.indyramp.com/masq/ before posting! */
I think that changing the code to this below will solve your problem:
if [ `id -un` = "root" ]; then
PS1="\[\033[1;31m\]\h:\w\$\[\033[0m\] "
else
PS1="\[\033[1;32m\]\h:\w\$\[\033[0m\] "
fi
Regards,
Raul
--
Raul Miguel Pinheiro de Carvalho
ISR - Instituto de Sistemas e Robotica, Porto
e-mail: [EMAIL PROTECTED]
On Mon, 27 Mar 2000, carl engstrom wrote:
> /* HINT: Search archives @ http://www.indyramp.com/masq/ before posting! */
>
>
> Sorry about this, It's pretty lame, but I keep getting the following error
> when I switch users or log in to the system
>
> bash: syntax error near unexpected token `then'
> bash: /etc/bashrc: line 10: `PS1 = if [ `id -un` = root ]; then'
>
> I think it's because of some typo in the bashrc file, but Ican't figure out
> where it is...I copied the improvements to bashrc directly from TrinityOS,
> (cut and paste) but I think I have an extra space or something. any help
> would be appreciated.
>
> here's the bashrc file
>
> # /etc/bashrc
>
> # System wide functions and aliases
> # Environment stuff goes in /etc/profile
>
> # For some unknown reason bash refuses to inherit
> # PS1 in some circumstances that I can't figure out.
> # Putting PS1 here ensures that it gets loaded every time.
>
> PS1 = if [ `id -un` = root ]; then
> PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
> else
> PS1='\[\033[1;32m\]\h:\w\$\[\033[0m\] '
> fi
>
> Thanks all
>
> Carl Engstrom
> [EMAIL PROTECTED]
>
> _______________________________________________
> Masq maillist - [EMAIL PROTECTED]
> Admin requests can be handled at http://www.indyramp.com/masq-list/ -- THIS INCLUDES
>UNSUBSCRIBING!
> or email to [EMAIL PROTECTED]
>
> PLEASE read the HOWTO and search the archives before posting.
> You can start your search at http://www.indyramp.com/masq/
> Please keep general linux/unix/pc/internet questions off the list.
_______________________________________________
Masq maillist - [EMAIL PROTECTED]
Admin requests can be handled at http://www.indyramp.com/masq-list/ -- THIS INCLUDES
UNSUBSCRIBING!
or email to [EMAIL PROTECTED]
PLEASE read the HOWTO and search the archives before posting.
You can start your search at http://www.indyramp.com/masq/
Please keep general linux/unix/pc/internet questions off the list.