X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=W3Iqf 9h/CjCwbpI3tu74WNIoom73nCv2Qu0tLw1eKF3V0wLqOpYU6XaLoVBKVuwLnfsaK 0JAydAJSbZiDOK76O7RE6gRPqtHzP+hbWqrvL7o5ZA8geJgeT/3eQCsCWW31Ir6i 0TFiGiIvbDz/WK+f/tcNfIrVbnC5Z9HJBenSrM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=uK648UPPyA5 2UbmUiBA2JtGY0/c=; b=clN4a+xKweXI+B8llRqbHZqUlkXbtvFwR4QwBie3SQi TFpBO7EC76WmD9gIJLClQIUElvRyMAokZK6Q8mY1gRxBCP6xr/TWQLZkiYUtqYfQ kI2YMVl7xr7bZ336Wr5nVbXnRFz34aHiEfrw7hCSKKpTqY9jmKBdekNGJc7hYWIc = Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:570102D, H*i:sk:570102D, among X-HELO: mail-in-16.arcor-online.net X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-06.arcor-online.net 3qdDJc4fMSz7m3S From: Achim Gratz To: cygwin AT cygwin DOT com Subject: Re: How to install a custom permanent postinstall handler? References: <838469265 DOT 20160401235308 AT yandex DOT ru> <87a8lcicxg DOT fsf AT Rainer DOT invalid> <5700975A DOT 3070002 AT cygwin DOT com> <87y48vqkfx DOT fsf AT Rainer DOT invalid> <570102D3 DOT 6000502 AT arcor DOT de> Date: Sun, 03 Apr 2016 14:02:40 +0200 In-Reply-To: <570102D3.6000502@arcor.de> (Dirk Fassbender's message of "Sun, 3 Apr 2016 13:47:31 +0200") Message-ID: <87a8la6gtb.fsf@Rainer.invalid> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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