From owner-freebsd-questions@FreeBSD.ORG Thu Mar 5 04:15:16 2009 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 05284106566B for ; Thu, 5 Mar 2009 04:15:16 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) by mx1.freebsd.org (Postfix) with ESMTP id 864EA8FC19 for ; Thu, 5 Mar 2009 04:15:15 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) by mailout.zetnet.co.uk with esmtp (Exim 4.63) (envelope-from ) id 1Lf4zH-0005qj-1a for freebsd-questions@freebsd.org; Thu, 05 Mar 2009 04:15:11 +0000 Received: from melon.esperance-linux.co.uk (54-144.adsl.zetnet.co.uk [194.247.54.144]) by zetnet.co.uk (8.14.1/8.14.1/Debian-9) with ESMTP id n254FALj013855 for ; Thu, 5 Mar 2009 04:15:10 GMT Received: by melon.esperance-linux.co.uk (Postfix, from userid 1001) id 50DC6FCA4DB; Thu, 5 Mar 2009 04:15:05 +0000 (GMT) Date: Thu, 5 Mar 2009 04:15:05 +0000 From: Frank Shute To: freebsd-questions@freebsd.org Message-ID: <20090305041505.GA35138@melon.esperance-linux.co.uk> Mail-Followup-To: freebsd-questions@freebsd.org References: <20090304150803.GA30617@marge.bs.l> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090304150803.GA30617@marge.bs.l> User-Agent: Mutt/1.4.2.3i X-Face: *}~{PHnDTzvXPe'wl_-f%!@+r5; VLhb':*DsX%wEOPg\fDrXWQJf|2\,92"DdS%63t*BHDyQ|OWo@Gfjcd72eaN!4%NE{0]p)ihQ1MyFNtWL X-Operating-System: FreeBSD 6.4-RELEASE-p2 i386 X-Organisation: 'http://www.shute.org.uk/' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.1.7 (zetnet.co.uk [194.247.46.1]); Thu, 05 Mar 2009 04:15:10 +0000 (GMT) Subject: Re: /bin/sh does not read profile X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Frank Shute List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2009 04:15:16 -0000 On Wed, Mar 04, 2009 at 04:08:03PM +0100, Bertram Scharpf wrote: > > Hi, > > from "man sh": > > Invocation > [...] 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 in a user's home directory, if they > exist. [...] > > I use Slim (X login manager) which calls > > exec /bin/sh - ~/.xinitrc Usually ~/.xinitrc is parsed by the X server when it starts (startx is just a Bourne shell script) and you exec the last command (the window manager) in your ~/.xinitrc I've never before seen the syntax you've used and I think it comes from a misunderstanding of the manpage for sh and/or it's a bashism or a typo. E.g: /bin/sh -c somecommand (login shell - arg 0 starts with a dash) /bin/sh somecommand (not a login shell) > > I first wondered why none of my commands in "/etc/profile" and > "~/.profile" got executed. Finally, I modified > "/usr/src/bin/sh/main.c" to trace what files are read, recompiled > the "sh" command and: the only file that is executed is "~/.shrc". > > I just cannot believe that FreeBSD has such a severe bug. What is > going wrong here? > > Thanks in advance, > > Bertram > Regards, -- Frank Contact info: http://www.shute.org.uk/misc/contact.html