This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: #!/bin/sh and #!/bin/bash is not the same
- From: cyg Simple <cygsimple at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 22 Aug 2016 09:16:50 -0400
- Subject: Re: #!/bin/sh and #!/bin/bash is not the same
- Authentication-results: sourceware.org; auth=none
- References: <CA+7cx1oHkwK8vOV+2heYAhw=DhkrRfEvkbaj2pmH+x29ZP0T7Q@mail.gmail.com>
On 8/20/2016 1:42 PM, Morten Kjærulff wrote:
> Hi,
>
> I thought that #!/bin/sh in a script would be a bash, but it seems not
> to be - or what am I doing wrong?
>
If you want to ensure that you have a particular flavor of shell then
don't use /bin/sh. The reason to use /bin/sh is that POSIX ensures it
exists but it doesn't have to be bash, even on Linux. For a generic
shell script use ksh syntax, you'll find that it gets you further and is
supported by bash.
--
cyg Simple
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple