From owner-freebsd-questions@freebsd.org Sun Jun 5 18:01:31 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2658B6AA04 for ; Sun, 5 Jun 2016 18:01:31 +0000 (UTC) (envelope-from baho-utot@columbus.rr.com) Received: from cdptpa-oedge-vip.email.rr.com (cdptpa-outbound-snat.email.rr.com [107.14.166.230]) by mx1.freebsd.org (Postfix) with ESMTP id 6AF3B1122 for ; Sun, 5 Jun 2016 18:01:31 +0000 (UTC) (envelope-from baho-utot@columbus.rr.com) Received: from [75.187.32.8] ([75.187.32.8:53010] helo=raspberrypi.bildanet.com) by cdptpa-oedge01 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id C8/20-04697-AF864575; Sun, 05 Jun 2016 18:01:30 +0000 Received: from [192.168.1.40] (helo=baho-utot.bildanet.com) by raspberrypi.bildanet.com with esmtp (Exim 4.84) (envelope-from ) id 1b9cMc-0006hr-6s for freebsd-questions@freebsd.org; Sun, 05 Jun 2016 14:01:30 -0400 Subject: Re: sh[it] and What am I missing here? To: freebsd-questions@freebsd.org References: <57544c10.90e58c0a.cacbc.62fd@mx.google.com> <57545029.5060805@gmail.com> <6f157455-0bda-ef46-82dc-e97fb0c4a08b@columbus.rr.com> <86h9d7r09p.fsf@WorkBox.Home> From: Baho Utot Message-ID: <95af446b-4bca-e0c3-ba32-4c003fade6ea@columbus.rr.com> Date: Sun, 5 Jun 2016 14:01:30 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <86h9d7r09p.fsf@WorkBox.Home> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2016 18:01:31 -0000 On 06/05/16 13:52, Brandon J. Wandersee wrote: > Baho Utot writes: > >> So here is what I tried. >> Power on console ( boot computer ) >> Login in as root >> /bin/sh >> >> set # to show environment etc >> WTF SHELL says I am in csh???? >> >> It should say SHELL=/bin/sh >> >> Hence my question here as to what is going on. > It seems the $SHELL variable is derived from the settings for the > account you log into. That variable persists when you run another shell, > as (a) the base environment is inherited by child processes; and (b) the > (interactive) shell is just another running user program at that point, > not a base working environment itself. > > Log in as root and start a different (interactive) shell, and the > variable will remain unchanged. Log in as a normal user and start > another shell, and you'll get the same result. Log in as any user and > `su` to any other user---simulating a new login---and the value of the > variable will change to the user shell for the new account. > > As I understand it, you can have a script you've executed change the > variable having it simulate a login shell and parse a custom > configuration file. See the "Invocation" section of the sh(8) man page > for an explanation. > > Ok, But I think I will need to talk to Jack Daniels first then I will have a look at the man page