From owner-freebsd-questions@FreeBSD.ORG Tue Jul 11 14:33:31 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 A4E0F16A4EC for ; Tue, 11 Jul 2006 14:33:31 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out3.blueyonder.co.uk (smtp-out3.blueyonder.co.uk [195.188.213.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 239EB43D79 for ; Tue, 11 Jul 2006 14:33:28 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [172.23.170.145] (helo=anti-virus03-08) by smtp-out3.blueyonder.co.uk with smtp (Exim 4.52) id 1G0JIj-0004qR-Qp; Tue, 11 Jul 2006 15:33:25 +0100 Received: from [82.41.34.175] (helo=[192.168.0.2]) by asmtp-out3.blueyonder.co.uk with esmtp (Exim 4.52) id 1G0JIf-0003ky-Uo; Tue, 11 Jul 2006 15:33:22 +0100 Message-ID: <44B3B6B1.2050801@dial.pipex.com> Date: Tue, 11 Jul 2006 15:33:21 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.13) Gecko/20060515 X-Accept-Language: en MIME-Version: 1.0 To: Peter References: <20060711125448.GA77175@gothmog.pc> <20060711130938.72503.qmail@web60014.mail.yahoo.com> <20060711132336.GB77495@gothmog.pc> In-Reply-To: <20060711132336.GB77495@gothmog.pc> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Giorgos Keramidas , freebsd-questions Subject: Re: aterm -e screen does not source .bashrc 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: Tue, 11 Jul 2006 14:33:31 -0000 Giorgos Keramidas wrote: >On 2006-07-11 09:09, Peter wrote: > > >>I have the following in my .xinitrc file: >> >>aterm -e screen & >> >>What is happening is that neither /etc/profile nor ~/.profile are >>being read. How can I get either of them to be sourced? >> >> > >By default, xterm, rxvt, aterm and various other terminal emulators >start non-login shells. This means that .profile is not sourced by the >shell spawned by the terminal. You can enable a `login shell' inside >one of these terminal emulators with the -ls option: > > aterm -ls -e screen & > > But a better option, IMHO, is to correctly separate the functionality in your .profile from that in some other (e.g. .shinit) file. One is for only stuff that happens at login, one for stuff that happens regardless. from man sh > When first starting, the shell inspects > argument 0, and if it begins with a dash (-), the shell is also > consid- > ered a login shell. This is normally done automatically by the > system > when the user first logs in. A login shell first reads commands > from the > files /etc/profile and then .profile if they exist. If the > environment > variable ENV is set on entry to a shell, or is set in the > .profile of a > login shell, the shell then reads commands from the file named in > ENV. > Therefore, a user should place commands that are to be executed > only at > login time in the .profile file, and commands that are executed > for every > shell inside the ENV file. The user can set the ENV variable to some > file by placing the following line in the file .profile in the home > directory, substituting for .shinit the filename desired: > > ENV=$HOME/.shinit; export ENV IMHO, this one one of the ways that csh was miles ahead of sh as a login (as opposed to a scripting) shell. These days, of course, a modern shell like bash has many of the best features of both, and even sh can (finally) do command line editing. --Alex