From owner-freebsd-questions@FreeBSD.ORG Tue Jul 11 14:48:08 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 D3C2516A4DD for ; Tue, 11 Jul 2006 14:48:08 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id F118343D55 for ; Tue, 11 Jul 2006 14:48:05 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.pc (host5.bedc.ondsl.gr [62.103.39.229]) (authenticated bits=128) by igloo.linux.gr (8.13.7/8.13.7/Debian-1) with ESMTP id k6BEliAO004555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 11 Jul 2006 17:47:46 +0300 Received: from gothmog.pc (gothmog [127.0.0.1]) by gothmog.pc (8.13.7/8.13.7) with ESMTP id k6BEldJR080117; Tue, 11 Jul 2006 17:47:39 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.pc (8.13.7/8.13.7/Submit) id k6BEldg6080116; Tue, 11 Jul 2006 17:47:39 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 11 Jul 2006 17:47:39 +0300 From: Giorgos Keramidas To: Alex Zbyslaw Message-ID: <20060711144739.GA79957@gothmog.pc> References: <20060711125448.GA77175@gothmog.pc> <20060711130938.72503.qmail@web60014.mail.yahoo.com> <20060711132336.GB77495@gothmog.pc> <44B3B6B1.2050801@dial.pipex.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44B3B6B1.2050801@dial.pipex.com> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.681, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.72, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Peter , 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:48:09 -0000 On 2006-07-11 15:33, Alex Zbyslaw wrote: >Giorgos Keramidas wrote: >> 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. Yes, of course :-) > from man sh > > When first starting, the shell inspects argument 0, and if > it begins with a dash (-), the shell is also considered 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. Agreed. My current .bash_profile is basically a minimal wrapper around .bashrc these days: % gothmog % cat -n .bash_profile % 1 # Startup file for login instances of the bash(1) shell. % 2 # $RCS: giorgos/.bash_profile,v 1.10 2005/07/10 21:10:39 giorgos Exp $ % 3 % 4 # First of all, run a .bashrc file if it exists. % 5 test -f ~/.bashrc && . ~/.bashrc % 6 % 7 # The following section should be pretty minimal, if present at all. % 8 mesg y >/dev/null 2>&1 % 9 /usr/bin/true % gothmog %