Autoconf's suggestion to use bash as /bin/sh

Christopher Faylor
Fri Jun 22 08:05:00 GMT 2001

On Fri, Jun 22, 2001 at 09:36:18AM +0100, Cliff Hones wrote:
>Earnie Boyd wrote:
>> I suppose Cliff Hones had a question and wasn't just posting to be
>> posting and I assume the hidden question to be "Why does Cygwin not use
>> bash as sh?" and that is covered in the FAQ.  However, once upon a time
>> a long time ago Cygwin did use bash as sh.  It was discovered that
>> scripts and software builds would happen more quickly if ash was used as
>> sh.  So the next release of Cygwin after the discovery included ash as
>> sh.  This doesn't prevent you from using it now, simply `cp
>> /bin/bash.exe /bin/sh.exe' and you'll be compliant with the autoconf
>> suggestion.  However, you would have slowed down the functioning of
>> Cygwin scripts and package builds.
>I didn't really mean to be asking a hidden question.  Indeed I have
>wondered why Cygwin uses ash for sh, and many thanks for the
>explanation.  BTW, I couldn't find it in the FAQ - and I've just
>looked at all occurrences of bash (of which there are many!).
>My main reason for posting was simply the conflicting advice; given
>the frequent comments of "you shouldn't suggest that" when people
>raise the issue of copying or linking bash to sh, it seemed odd that a
>Red Hat document should be doing just that.
>And finally, maybe it would help if the "don't do that"
>messages gave a reason why it shouldn't be done,

Did you read Earnie's response?  He gave reasons.

What you're really asking is:

"I just installed cygwin and notice that it has a /bin/sh and a
/bin/bash.  I think I'll just copy /bin/bash to /bin/sh.  Why won't
you let me do this?"

You have the ability to do anything you want with cygwin.  However,
surely it makes sense that we must have had SOME reason for doing this
and if you decide to make your installation nonstandard then you should
not necessarily expect support for what you're doing from people who
decided to do things in such an incredibly incomprehensible way.

Btw, let me clear up a misconception.  The fact that a project exists on does not mean that it is a Red Hat project.  The
reference that you pointed to contains words written by four people, two
of whom are Red Hat employees.  That doesn't make it an official Red Hat

However, even if it was a Red Hat project, it shouldn't be too
surprising that a large company could produce conflicting documents.

Hmm.  I just looked at the words in question and they seem pretty benign
to me:

Bourne shell 
Cygwin provides a port of ash which is smaller and faster than bash, but
sometimes rejects arcane Bourne shell scripts.  If you can stand to
sacrifice a little speed, it is worth copying the supplied bash.exe to
`/bin/sh.exe' to forestall any such problems

The words actually describe the reason for ash and describe the
consequences of overwriting /bin/sh.

We usually tell people "don't do that" when they copy /bin/bash over
/bin/sh because of a bug in /bin/sh.  The hoped for method of dealing
with bugs is that someone reports them (and hopefully provides a patch).
Just silently working around the problem means that random people will
trip over it and the problem will exist until someone decides to report

Anyway, I just searched the FAQ for words about this, and I didn't
find any either.  Chuck, could you add some words, please?


Want to unsubscribe from this list?
Check out:

More information about the Cygwin mailing list