delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/09/04/16:17:52

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=MuXm15L
nDeiPZvOepF+WLmTbN0j++VuXUnrq/8gXH7Z400LpB6+jDHtxm9u2Aw4gqCHlHGJ
PQlni7fKFM9zS4TfenJMV8OJmDkB0SlLszViONl46K8VyX3lajNRMM7I/hRL4aKJ
DCIE0mvSxMxGnjrYKLqIjJ+SqOaLgsjAX294=
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=FT7go4d/Qp4aV
qT2f3XXRgbmHCk=; b=CGVDYBlz965A9JlJuNzwJYVTiY/C4oz4o8Tf9dIj/NsnQ
6bq8Uy3zDjOOLyUKlMAGtRDDG87gRyy7JnazNwafkcWtcICCmRo/f1ZKX86cWJdp
NKph2/QwRG+HGhR+hfYm/WnJzta1gljPsLD5ziG9ufDKzH3C7ECDwHGtrRbxNU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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_20,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=investigated, eblakeredhatcom, eblake AT redhat DOT com, pipes
X-HELO: mail-it0-f53.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=3VS9m+ncrSQzAnQvMBvzAcc8Sk9D5SNpsISk35MmBgs=; b=lStf7D/JImzYDUvukRw13HciY3uLiQtrbhxtXLVqzwBCyIaVCHT2xO2Jkqftb5wr8m E8QPHjr/VmB25hYNS5JOMnom/i7uol+b0kjtWmPvHVT4fvhYjC/qMuXexbks7XG3zPEb jFD7HplLjeseJYKCOCtGmy966pSm5k7K7TWP23lNEHC1EnOdRlna8/odr+3rXRiECckL UcinB0qhIn/qI0tiygpPMrWUoQBJNeF5grVBoGFPw/isqN7mkZQv0hNP0t7lfmC4CJiN 1zVTmm73JZUKcSHzfpkvRisX5dSMHahGHz9m9ae3fjBkQXLOIHAZmKjHdx4N8uKGHutk I2SA==
X-Gm-Message-State: AE9vXwO2cpDiFLhRZWNSE4l7HXehFMc5YhJtCIDf6ofw31N6PMd05FZ5Shz02WqUkaWl4NPk0TLhWbhqLoapkg==
X-Received: by 10.36.225.72 with SMTP id n69mr14142741ith.16.1472980259672; Sun, 04 Sep 2016 02:10:59 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <a3b97bcb-d880-23b3-3acb-e68276509bde@redhat.com>
References: <CAPTiy3PE0gZ-hpvQbxVkfaZfxtppDx7RG85WtuigpnL54WZbDA AT mail DOT gmail DOT com> <CAPTiy3N-n5krtWcZuK8-pBQE_efzroS6rizknHqU2tE+BYaMQQ AT mail DOT gmail DOT com> <8980687a-967e-88d8-2a94-f485731fafe9 AT redhat DOT com> <9940d9b9cd565fbb0d5b395565197dfd AT xs4all DOT nl> <0294c48e-8e96-f554-3e05-6b7771dfb96e AT redhat DOT com> <CAPTiy3Ow6b6n7Nfd+DHpfnw-W7Y_ZAXS4+CqQaX8BzsV=hhkow AT mail DOT gmail DOT com> <a3b97bcb-d880-23b3-3acb-e68276509bde AT redhat DOT com>
From: Gene Pavlovsky <gene DOT pavlovsky AT gmail DOT com>
Date: Sun, 4 Sep 2016 12:10:59 +0300
Message-ID: <CAPTiy3NvnSd3pf_1P7iYHO0bPryZauoT_3gomaNbv_5qrxo6-A@mail.gmail.com>
Subject: Re: bash: igncr shell option breaks my PS1 prompt
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

On 2 September 2016 at 16:32, Eric Blake <eblake AT redhat DOT com> wrote:
> On 09/02/2016 06:52 AM, Gene Pavlovsky wrote:
>> Dear Eric Blake,
>>
>> Basically, I don't want to set `igncr` as system-wide shell option
>> (e.g. through SHELLOPTS).
>
> Don't use it, then.  I highly recommend avoiding 'igncr', because it
> exists only as a crutch.  The real solution is to fix your environment
> to be binary-clean, at which point you no longer need igncr. But I also
> understand that fixing an environment to be binary-clean can be
> expensive, so 'igncr' remains as the crutch.

Exactly, so I would really prefer to avoid crutches.

>> So, how do I keep an existing bash script, that uses `read` piped from
>> the output of a Windows console program that uses CRLF as newlines,
>> working, without modifying the script? I don't see how it's possible
>> with the current situation.

> By piping the output of the Windows program through d2u before handing
> it to 'read'.

The script in question (at the moment) is
[AutoMySQLBackup](https://sourceforge.net/projects/automysqlbackup/).
I didn't make it, I might want to update it when a new version comes
out. Having to add either "set -o igncr" or "| d2u" to the script
creates a maintainability problem - if I ever update it, I should
remember that I did that to this script, and do it again after an
update.
I could make a wrapper for mysql.exe, that pipes it's output through
d2u - which sounds like a bad crutch as well.
Worst thing is, I should spend time investigating why some (other)
script is failing in a non-obvious fashion. Looking through the code
to find out which Windows program it uses that should be piped through
d2u.

No matter how you look it at, the recent change to `read` might have
broken many scripts that were functioning before.
The solution you suggested means broken scripts should first be found,
then investigated, then some Cygwin-specific code added to them. That
sounds like a lot of work, and if the scripts in question are
third-party, a maintainability problem. At the moment, I'm forced to
use an older version of bash due to this particular issue.

Do you see a better solution here?

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019