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: How to install a custom permanent postinstall handler?


Dirk Fassbender writes:
> So it is not easy to write portable scripts for the standard shell
> /bin/sh between different systems and the exchange of the standard
> shell needs a check for all scripts, that uses a shebang line /bin/sh
> or are use during system initialisation.

Whatever is under /bin/sh is supposed to be POSIX compliant.  If you
make use of your knowledge of what shell this actually is (dash, posh,
bash, busybox, etc.), then you're by definition not interested in having
a portable script and could just as easily use a different shebang line.

> I personally prefer to use a shebang line set to the shell type used
> (ksh, bash, dash). This is more portable for different system types.

You're specifying a shell type and only have to deal with portability
among the versions of that shell.  But you're explicitly saying your
script (possibly) isn't POSIX compatible.

> For putting the /bin/sh under alternatives control on cygwin there
> must be some preparations.
> There are several postinstall and preremove scripts without a shebang
> line or with  a shebang line /bin/sh or /usr/bin/sh. Are all of these
> scripts written to run correctly with a bash and dash invoked ?

The shebang line isn't even looked at for the postinstall scripts.  The
suffix is what determines which shell gets to run the scripts.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves

--
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]