This is the mail archive of the
mailing list for the Cygwin project.
Re: bash: igncr shell option breaks my PS1 prompt
- From: Gene Pavlovsky <gene dot pavlovsky at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Sun, 4 Sep 2016 12:10:59 +0300
- Subject: Re: bash: igncr shell option breaks my PS1 prompt
- Authentication-results: sourceware.org; auth=none
- References: <CAPTiy3PE0gZ-hpvQbxVkfaZfxtppDx7RG85WtuigpnL54WZbDA@mail.gmail.com> <CAPTiy3N-n5krtWcZuK8-pBQE_efzroS6rizknHqU2tE+BYaMQQ@mail.gmail.com> <email@example.com> <firstname.lastname@example.org> <email@example.com> <CAPTiy3Ow6b6n7Nfd+DHpfnw-W7Y_ZAXS4+CqQaX8BzsVfirstname.lastname@example.org> <email@example.com>
On 2 September 2016 at 16:32, Eric Blake <firstname.lastname@example.org> 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
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
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
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?
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple