From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) by sourceware.org (Postfix) with ESMTPS id 1BE8E3858D32 for ; Fri, 7 Apr 2023 19:34:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BE8E3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=Shaw.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=shaw.ca Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id kosQp16vHjvm1krrFpuOj0; Fri, 07 Apr 2023 19:34:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20180605; t=1680896089; bh=Ku3LQGtEYWr4wS9RusiIzYczU8iq6Q6fafzwVLiaxhY=; h=Date:Reply-To:Subject:To:References:From:In-Reply-To; b=E8zIS1iOEcyqKp8+4s08tgXWg2/9dJ2ezAO+bBwSyFkzHqetUSoehDFoKizjiwVme pLahQEDZs7Y0Z89HTBneJsu1hYmNAoLOSHXxR7eIIEk3tN6DRx6ZOm3YyuQOvHoTY5 vmY+5c8uM0un2or7EGdvYrH/NcU6VHmIEH983uDzTLePIwJ5K1Wlud1qDqIeq50UKe uuf5+MyI/chYpVxFDP2NTbzliAdiA24yi9ihtbum6M+zU1AHs6j/O796HFSO8L0Azs 5phcBddYr5COQu5DHeMeArWymLo5AqJ+tPK1/FiUnj7iHDnempKs6pkd5YLBKNCh3T T9qYw0b7uDYoA== Received: from [10.0.0.5] ([184.64.102.149]) by cmsmtp with ESMTP id krrFp9S7eyAOekrrFpRLtf; Fri, 07 Apr 2023 19:34:49 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=64307059 a=DxHlV3/gbUaP7LOF0QAmaA==:117 a=DxHlV3/gbUaP7LOF0QAmaA==:17 a=IkcTkHD0fZMA:10 a=pgErXLZoTj4Q0FFUzHAA:9 a=QEXdDO2ut3YA:10 Message-ID: <6bb05948-2362-6cb8-532a-2dfd59a746d3@Shaw.ca> Date: Fri, 7 Apr 2023 13:34:49 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Reply-To: cygwin@cygwin.com Subject: Re: bash shell script: recently running, now failing Content-Language: en-CA To: cygwin@cygwin.com References: <44687390.20230406152114@yandex.ru> From: Brian Inglis Organization: Inglis In-Reply-To: <44687390.20230406152114@yandex.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfPh8XVkpKQhZuEJTa7Y21cgSEZ24FAvOUvZBWPW2Zm4QYNkYu7/Xl2bbGqjPC5oCZ57Z1hV0SlgmhjJCScyt46gcZgOKQNPbAorc2Y3dBcANF/9GN9Fe Vqn2H+KAwzEGmKaE+TlrT7Mo8jjyxsYbwxv/5dGYTBWG1VZoC8z0urdJadmeixOuK/9cOcj3iUu7KQ== X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-04-06 06:21, Andrey Repin via Cygwin wrote: >> I have a "hash bang" bash shell script i.e. first line >> #! /bin/sh >> or equivalently >> #! /bin/bash > By default, sh is bash in base Cygwin installation. >> Q3 - at 1/8 the size of bash and sh, I am not at all sure of the role and reach of dash. >> Should the edit (dash replacing bash/sh) be incorporated elsewhere or would this be a >> bad idea (and retained only locally in what is indeed an eccentric and one-off context)? > I'm replacing /bin/sh with dash as I've found that even in POSIX mode, bash > allows for a lot of bash'izms in scripts, which would not otherwise run under > (d?a)?sh. > See the post-install script attached. You should use either a hard link or copy of d/ash from/to /bin/ to allow it (or any shell) to be used from Windows cmd shells or Scheduled Tasks, which do not recognise Cygwin /usr mounts or symlinks, but can be run with elevated privileges and at sometimes more useful points than user cron jobs. For example, "manually" restarting Cygwin services after delayed startup, stopping Cygwin services and processes before upgrades, and cleaning up cron jobs that have not finished. You should also consider changing the sh man page. -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry