Date: Wed, 14 May 2008 19:52:33 -0500 From: Derek Ragona <derek@computinginnovations.com> To: "Montag" <montag@activeattack.com>, "freebsd questions" <freebsd-questions@freebsd.org> Subject: Re: Configuring Bash Message-ID: <6.0.0.22.2.20080514195044.026c43b0@mail.computinginnovations.com> In-Reply-To: <1210810823.5782.1253224263@webmail.messagingengine.com> References: <1210810823.5782.1253224263@webmail.messagingengine.com>
next in thread | previous in thread | raw e-mail | index | archive | help
At 07:20 PM 5/14/2008, Montag wrote: >This should be a fairly simple process, I don't really know what I am >missing. > >I've got the following in the .bash_profile of a basic user account: > ># set prompt [user@host--/dir] $ (# for root) >PS1 = ' [\u@\h--\w] ' >case `id -u` in > 0) PS1='${PS1} # ';; # root > *) PS1='${PS1} $ ';; # everyone else > >When I log in, I am greeted with: >${PS1} $ $ > >However, if I su to root, I get: >[root@host-- /home/user]# > >That is what I wanted, but for some reason it is not working for a >normal user. I thought perhaps the problem could be that .bash_profile >is only loaded when a non-login shell is spawned, but a quick >consultation of man bash revealed that bash reads ~/.bash_profile when >it is invoked as a login shell. > >My next thought was that it was a permissions issue, but: >su >chmod 777 .bash_profile >exit >logout >login > >That did not change the results, the output was still the same as above. > This is all being done at the console, by the way. > >Appreciate any advice, > >montag Check how the shell is invoked via /etc/passwd Are you saying it works if you: su - root But logging in as a regular user. So, can you: login as a regular user su - root su - [regular user] What does this produce? -Derek -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20080514195044.026c43b0>