From owner-freebsd-questions@freebsd.org Sun Jun 5 16:46:48 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 C2571B6AFFF for ; Sun, 5 Jun 2016 16:46:48 +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.227]) by mx1.freebsd.org (Postfix) with ESMTP id 8AD461F52 for ; Sun, 5 Jun 2016 16:46:47 +0000 (UTC) (envelope-from baho-utot@columbus.rr.com) Received: from [75.187.32.8] ([75.187.32.8:52948] helo=raspberrypi.bildanet.com) by cdptpa-oedge03 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id E6/D7-11286-77754575; Sun, 05 Jun 2016 16:46:47 +0000 Received: from [192.168.1.40] (helo=baho-utot.bildanet.com) by raspberrypi.bildanet.com with esmtp (Exim 4.84) (envelope-from ) id 1b9bCI-0006fP-QD for freebsd-questions@freebsd.org; Sun, 05 Jun 2016 12:46:46 -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> <5754550A.6020500@holgerdanske.com> From: Baho Utot Message-ID: <02a5bb3c-e19a-221c-d30f-0feacebbf928@columbus.rr.com> Date: Sun, 5 Jun 2016 12:46:46 -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: <5754550A.6020500@holgerdanske.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.142: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 16:46:48 -0000 On 06/05/16 12:36, David Christensen wrote: > On 06/05/2016 09:30 AM, Baho Utot wrote: >> No I don't want to have sh as my shell or change the default shell. >> I am just writing a script to build packages from ports on a new >> install. >> As bash is not available but sh was I'll use that to script into. >> >> Now when I was writing the script syntax that should have been a Ok in >> sh it was/is failing. >> After some head scratching I found that maybe I wasn't really using or >> in a bourne shell ie /bin/sh. >> That made me think that even though I have #!/bin/sh at the top of the >> script some how I wasn't really getting sh but csh. >> >> 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. > > Is your script executable? > > # chmod +x scriptname Yes > > > Does it have a shebang line? > > #!/bin/sh > > Yes > Does it make use of the SHELL variable? > > No It also behaves as if it is in tcsh/csh from the command prompt.... Ok you can try this from home ; ) login in as a user ( non root ) set SHELL is set to SHELL=/bin/sh Ok now try su - (give password) set SHELL=/bin/csh Ok that makes sense Now /bin/sh set SHELL=/bin/csh WTF? Log out of all the login as root set SHELL=/bin/csh Ok that makes sense /bin/sh set SHELL=/bin/csh WTF? It looks to me ( if I am not missing something here ) That I can only get to sh by loging in as a user...Again WTF