Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jun 2016 09:36:26 -0700
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: sh[it] and What am I missing here?
Message-ID:  <5754550A.6020500@holgerdanske.com>
In-Reply-To: <6f157455-0bda-ef46-82dc-e97fb0c4a08b@columbus.rr.com>
References:  <57544c10.90e58c0a.cacbc.62fd@mx.google.com> <cdf04501-79ef-9dbb-14f0-ed10a6d7241e@columbus.rr.com> <57545029.5060805@gmail.com> <6f157455-0bda-ef46-82dc-e97fb0c4a08b@columbus.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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


Does it have a shebang line?

     #!/bin/sh


Does it make use of the SHELL variable?


David




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5754550A.6020500>