This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: #!/bin/sh and #!/bin/bash is not the same


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]