From owner-freebsd-questions@FreeBSD.ORG Thu May 15 00:51:08 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F368106564A for ; Thu, 15 May 2008 00:51:08 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (mail.computinginnovations.com [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id BF2C58FC15 for ; Thu, 15 May 2008 00:51:07 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.14.2/8.14.2) with ESMTP id m4F0omE4097832; Wed, 14 May 2008 19:50:48 -0500 (CDT) (envelope-from derek@computinginnovations.com) Message-Id: <6.0.0.22.2.20080514195044.026c43b0@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Wed, 14 May 2008 19:52:33 -0500 To: "Montag" , "freebsd questions" From: Derek Ragona In-Reply-To: <1210810823.5782.1253224263@webmail.messagingengine.com> References: <1210810823.5782.1253224263@webmail.messagingengine.com> Mime-Version: 1.0 X-Antivirus: avast! (VPS 080514-0, 05/14/2008), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: ClamAV 0.93/6806/Wed Apr 16 15:50:16 2008 on betty.computinginnovations.com X-Virus-Status: Clean X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: m4F0omE4097832 X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: Configuring Bash X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2008 00:51:08 -0000 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.