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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; q=dns; s=default; b=cl3JAj2 ugfsRJJy8EjXcF4DeLfgpQKFBS/wJ6PkpSqFFmfqo5wLPdmPbgfe/uN58ylXg1VD iIziZwXfSqADJDpiwDgV02qzO3K2lxU77thHgrLa9VHsZOV6HGc7zQvtpH+mcIM3 A/yWtLMxKB6L+dKsNs6LpgMwd93hx/RdWW18= 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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; s=default; bh=s/XKkjvnM6AKS xdy8eB/geVHzs0=; b=uZBPTPvw4c/a5sroRup4048T9n3D1L7jpmCHfxDHFfjH1 Juo5j3DhLL21Y0ZoZQGRUaTmtnL1LqQjsnIVnccqzhPe0+ZWEzFS0Kv9QMdnpvmo iKXMY7pV0VFY1ndS7MvMKyvQCg04X2ojg7ePx9eFNPzEURdmXKk+pw4SR+y0/E= 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=-1.3 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Pavlovsky, sk:genepa, sk:gene.pa, gene DOT pavlovsky AT gmail DOT com X-HELO: mail-it0-f42.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=P3rkibX6cpMTdRucPbfmkub5yAUTcSxEN5X4zIid4MA=; b=Fwj4tWDEo2fwUUc5bGRH7NoslQrPP0lOCL40VkXz87byeF/QoEDtLRrwTwg9TczK/n hS4YgKj6x/A21bwn0K8BGDY0R5CRw3ABVyMUNERMEnN8bBR1ONZ/JkFsc8SdXaBRC7Pm hiPRN592ZxDFucbiveNNNFAKVUfJlSnBIDdh45LLr6SoZOlTZ/cxKdrIowlqUFlbHCuJ 0mqT1nPWKQrg9r2v1h2h8zu9iWYgqqdrrHZkxa2Z5xnWHaKASOosQIdOeR4E4TXKknLy XvGGxdww2eb6fUab76mLCLEZhlY+AUCshV9MDFEFLKgL7TN0IQ5HCRRM+8VYBkoZZFiF fEVA== X-Gm-Message-State: AE9vXwNNXhcEsE9dHALhtbZ12/R6+FaySj23laoBYu3iq1DxB/oH5N90M7+5+z6BdGMtKBy6Cow0IZ526nJGWw== X-Received: by 10.107.135.142 with SMTP id r14mr7602528ioi.133.1472256265445; Fri, 26 Aug 2016 17:04:25 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Gene Pavlovsky Date: Sat, 27 Aug 2016 03:04:25 +0300 Message-ID: Subject: Re: Script broken after updating bash to 4.3.46-7? To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes 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. --Gene On 27 August 2016 at 02:49, Gene Pavlovsky wrote: > After I updated Cygwin yesterday, a daily database backup bash script > (`automysqlbackup`) broke. > My previous bash was 4.3.42-4 (installed when I updated Cygwin on > 2016/07/23), current is 4.3.46-7. > Here's the code snippet: > ```bash > local i;i=0; > while read -r; do alldbnames[i++]="$REPLY"; done < <(mysql > --user="${CONFIG_mysql_dump_username}" > --password="${CONFIG_mysql_dump_password}" > --host="${CONFIG_mysql_dump_host}" "${mysql_opt[@]}" --batch > --skip-column-names -e "show databases") > ``` > This is supposed to get the list of all databases. Before it worked. > Now every item on the list ends with the CR character ($'\r'), causing > a bunch of issues with further script opreation. I'm using official > MariaDB Windows x64 binaries. > Frankly if mysql does output CRLF line endings, I don't know why that > script worked before, considering that this command in an interactive > shell produces a similar result: > ```bash > # echo $'information_schema\r' | { read -r var; echo "{$var}"; } > }information_schema > ``` > But it did work somehow... Question is - what made it stop working > now, and what would be best way to fix it? > > Regards, > Gene. -- 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