From owner-freebsd-questions@FreeBSD.ORG Tue Apr 12 06:08:24 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E8EE16A522 for ; Tue, 12 Apr 2005 06:08:24 +0000 (GMT) Received: from szamoca.krvarr.bc.ca (szamoca.krvarr.bc.ca [142.179.111.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC9F143D31 for ; Tue, 12 Apr 2005 06:08:23 +0000 (GMT) (envelope-from sandy@krvarr.bc.ca) Received: from szamoca.krvarr.bc.ca (localhost [127.0.0.1]) by szamoca.krvarr.bc.ca (8.13.1/8.12.11) with ESMTP id j3C68Kw8020230 for ; Mon, 11 Apr 2005 23:08:20 -0700 (PDT) (envelope-from sandy@szamoca.krvarr.bc.ca) Received: (from sandy@localhost) by szamoca.krvarr.bc.ca (8.13.1/8.12.11/Submit) id j3C68Ke2020227; Mon, 11 Apr 2005 23:08:20 -0700 (PDT) (envelope-from sandy) From: Sandy Rutherford MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16987.26062.936064.579667@szamoca.krvarr.bc.ca> Date: Mon, 11 Apr 2005 23:08:14 -0700 To: freebsd-questions@freebsd.org In-Reply-To: <20050411081225.GB4192@alzatex.com> References: <000f01c53cdf$b8242fc0$9900000a@ZGISH> <20050411081225.GB4192@alzatex.com> X-Mailer: VM 7.07 under Emacs 21.3.1 X-krvarr.bc.ca-MailScanner-Information: Please contact postmaster@krvarr.bc.ca for more information. X-krvarr.bc.ca-MailScanner: Not scanned: please contact postmaster@krvarr.bc.ca for details. X-krvarr.bc.ca-MailScanner-From: sandy@szamoca.krvarr.bc.ca Subject: Re: Loading .bash_profile under X-Windows X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2005 06:08:24 -0000 >>>>> On Mon, 11 Apr 2005 01:12:25 -0700, >>>>> "Loren M. Lang" said: > On Sat, Apr 09, 2005 at 10:40:01AM +0200, Kiffin Gish wrote: >> How can I get terminal under X-Windows to load my .bash_profile (and any >> other stuff) that is usually loaded when at the initial prompt? >> >> A more general question might be: what files (.profile, .login, whatever) >> and in what order are loaded every I login via a shell and how are these >> settings propagated up through Gnome desktop? ...snip... > The first shell was just started normally and the second was started as > a login shell. Connecting to a machine through ssh or logging in on a > text console starts a login shell, but running an xterm in X-Windows or > running bash from whatever shell your already in isn't since your > already logged in. If you start X-Windows with the startx command, your > login is considered when you first logged in on the text console and > that same environment is propagated to the gui environment, gnome in > your case. When you log in from a graphical log in utility, it's a > little more complicated. The gui login program, whether it be xdm, gdm, > or kdm starts a shell script which eventually starts your gui > environment. The problem is that it's not usually the same as your > login shell, but whatever shell was used to write the script. In some > cases you can write your own shell script called .xsession or .Xclients > in your home directory and it can load in .bash_profile and then start > gnome. Depending on what kind of stuff you put in your .bash_profile file, I have found it convenient to separate the bits that I would like to be run by the gui login program from what I would like to be run when I login via ssh or a terminal. I do this by putting all environment variable settings in a file, .bash_env. Both my .bash_profile and .xsession files source this file. Sandy