public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Script broken after updating bash to 4.3.46-7?
@ 2016-08-27 10:28 Gene Pavlovsky
  2016-08-27 11:25 ` Gene Pavlovsky
  2016-08-30  3:21 ` Eric Blake
  0 siblings, 2 replies; 14+ messages in thread
From: Gene Pavlovsky @ 2016-08-27 10:28 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-09-06 13:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-27 10:28 Script broken after updating bash to 4.3.46-7? Gene Pavlovsky
2016-08-27 11:25 ` Gene Pavlovsky
2016-08-27 17:24   ` Andrey Repin
2016-08-28 10:19     ` Gene Pavlovsky
2016-08-29 13:28       ` Nellis, Kenneth
2016-08-29 14:05     ` cyg Simple
2016-08-30  3:21 ` Eric Blake
2016-08-30 18:21   ` cyg Simple
2016-08-30 18:32     ` Eric Blake
2016-08-31 10:16       ` cyg Simple
2016-09-04  9:38         ` Gene Pavlovsky
2016-09-04 17:37           ` Lee
2016-09-05 23:37             ` Gene Pavlovsky
2016-09-06 13:15           ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).