From owner-freebsd-questions@freebsd.org Sun Jun 5 17:15:28 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 02C81B69DB7 for ; Sun, 5 Jun 2016 17:15:28 +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.228]) by mx1.freebsd.org (Postfix) with ESMTP id C06561799 for ; Sun, 5 Jun 2016 17:15:27 +0000 (UTC) (envelope-from baho-utot@columbus.rr.com) Received: from [75.187.32.8] ([75.187.32.8:52961] helo=raspberrypi.bildanet.com) by cdptpa-oedge02 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 2A/2C-08765-E2E54575; Sun, 05 Jun 2016 17:15:26 +0000 Received: from [192.168.1.40] (helo=baho-utot.bildanet.com) by raspberrypi.bildanet.com with esmtp (Exim 4.84) (envelope-from ) id 1b9be1-0006g4-SJ for freebsd-questions@freebsd.org; Sun, 05 Jun 2016 13:15:25 -0400 Subject: Re: sh[it] and What am I missing here? To: freebsd-questions@freebsd.org References: <31b2cfb1-1da8-9262-3f03-d964776c905e@columbus.rr.com> <575453F9.9070508@holgerdanske.com> From: Baho Utot Message-ID: <4daed7a2-9a0b-15d9-0bb2-31227f8fcddd@columbus.rr.com> Date: Sun, 5 Jun 2016 13:15:25 -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: <575453F9.9070508@holgerdanske.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.130: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 17:15:28 -0000 On 06/05/16 12:31, David Christensen wrote: > On 06/05/2016 08:38 AM, Baho Utot wrote: > ... >> root@baho-utot:~ # set > ... >> shell /bin/csh > ... >> tcsh 6.18.01 > ... >> OK tcsh as I thought > ... >> OK switch shells >> >> root@baho-utot:~ # /bin/sh >> # set > ... >> Why is the SHELL variable still set to /bin/csh > ... > > Because you are invoking a program (/bin/sh) and that program did not > modify the SHELL environment variable. > > > On 06/05/2016 09:15 AM, jd1008 wrote: > > Do I understand correctly that you want bash to be your shell? > > If so, you can run (as root), the command > > chsh > > +1 > > Take a look at: > > https://www.freebsd.org/doc/en/articles/linux-users/shells.html > > > David I understood that, But I do not want to change the default shell. I only want to create a script ( sh script ) and run if from a clean machine with just base install nothing else and then run my sh script to build some ports. That's were the trouble lies. ie functions not returning status for example: test.sh chmod +x test.sh #!/bin/sh func() { echo "Yep it's me" return 1 } if [ func ] ; then # if [ 1 = func ] or if [ 1 -eq func ] doesn't work either echo "This works" fi ./test.sh [: func: unexpected operator