From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43179 invoked by alias); 29 Aug 2016 13:06:53 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 42147 invoked by uid 89); 29 Aug 2016 13:06:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=dawn, bicycle, H*MI:sk:1635303, Hx-spam-relays-external:209.85.214.48 X-HELO: mail-it0-f48.google.com Received: from mail-it0-f48.google.com (HELO mail-it0-f48.google.com) (209.85.214.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Aug 2016 13:06:50 +0000 Received: by mail-it0-f48.google.com with SMTP id e63so101323825ith.1 for ; Mon, 29 Aug 2016 06:06:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=mbTsN6QsoM40Tg1rSVvsVZPDEF+NS6eXOI8r7jywOlE=; b=lNabkg06TIIMrAM4lEnAQ2yvAa9CCk7vF678z8r2sMdL9vbowO36mHhxSvOoYnuXLD bv1W1v+N3fuzFLgI4wMEvqqa1+kSeuIaCmv4DvE4TaFY2TSBVNuLjnpmGUPz2eeiUid0 Ir4A7MrYC6tS0/OWb8COw6XywfTtEzfJuqdM5gnhmEZSoXDRK0Fius1ZYNeOJZGO1J9U 5kplRK6WB1JDFsLR+Gkq2LpqnKoXLCtwIL1kF6EavytkbM9IxS525raySAxYRss78KYA uGhI9ivSPH+0ffZ/bv8tfJk6q0ckcEzdE9Gpc8xfSHZ5tLlE0Kuccl8J1oEEfX34UWSB z+nA== X-Gm-Message-State: AE9vXwPryrkJAUDe9959vSUrQky2b9W9oKnoEO4Y4RtkJgXZPw8zys1/9x38SjC4vN/9OA== X-Received: by 10.36.31.18 with SMTP id d18mr15315555itd.84.1472476008643; Mon, 29 Aug 2016 06:06:48 -0700 (PDT) Received: from [192.168.0.12] (d27-96-48-76.nap.wideopenwest.com. [96.27.76.48]) by smtp.gmail.com with ESMTPSA id r200sm6182600itc.13.2016.08.29.06.06.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Aug 2016 06:06:48 -0700 (PDT) Subject: Re: Script broken after updating bash to 4.3.46-7? To: cygwin@cygwin.com References: <1635303092.20160827191501@yandex.ru> From: cyg Simple Message-ID: <3ddc1bf3-7226-b163-fd51-cf0c22f850c7@gmail.com> Date: Mon, 29 Aug 2016 14:05:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1635303092.20160827191501@yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00580.txt.bz2 On 8/27/2016 12:15 PM, Andrey Repin wrote: > Greetings, Gene Pavlovsky! > >> Looks like it's related to a recent change in bash, which is `read` >> now honors Cygwin-specific `igncr` shell option (`set -o igncr`), >> which I didn't enable. >> Adding `set -o igncr` to the top of the script does the job, however >> I'd like to know how many more scripts are potentially malfunctioning >> now? >> It's lucky that one sent e-mails on errors, some others might just >> break silently. >> Is it advisable to add `set -o igncr` to /etc/profile or SHELLOPTS? I >> didn't use that feature before and am worried about some other >> negative side effects. > > It is advisable to not have CR's in your scripts to begin with. > I thought this was about the data the script was reading and not the script itself. Data can have \r regardless of where in the data it exists. That said relying on defaults for a process has been taboo since the dawn of computing. Often defaults change on a whim, they are bicycle shed colors, a maintainer may prefer blue instead of red in any given release. If your script requires a specific mode for the shell to process data properly then be sure to set it before reading the data. -- 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