delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/06/17:50:19

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <008c01c2ce32$1b7c1ac0$43140944@ri.cox.net>
From: "mstucky5" <mstucky5 AT cox DOT net>
To: "Nicolas Christin" <nicolas AT cs DOT virginia DOT edu>, <cygwin AT cygwin DOT com>
References: <Pine DOT GSO DOT 4 DOT 53 DOT 0302061048490 DOT 1087 AT arachnion DOT cs DOT Virginia DOT EDU> <00e101c2cdf8$79490fd0$78d96f83 AT pomello> <Pine DOT GSO DOT 4 DOT 53 DOT 0302061104010 DOT 1132 AT arachnion DOT cs DOT Virginia DOT EDU> <00ed01c2cdfc$8b6cc810$78d96f83 AT pomello> <Pine DOT GSO DOT 4 DOT 53 DOT 0302061128430 DOT 1166 AT arachnion DOT cs DOT Virginia DOT EDU>
Subject: Re: Detecting text type in a shell script
Date: Thu, 6 Feb 2003 17:50:11 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

----- Original Message -----
From: "Nicolas Christin" <nicolas AT cs DOT virginia DOT edu>
To: <cygwin AT cygwin DOT com>
Sent: Thursday, February 06, 2003 11:51 AM
Subject: Re: Detecting text type in a shell script


> On Thu, 6 Feb 2003, Max Bowsher wrote:
>
> > Have you tried linking you app with -lbinmode ? That should force
all
> > file access to be binary, whatever the mount.
>
> No - but that's a very good point - worth trying out. Thanks a bunch.
>
> On Thu, 6 Feb 2003, David Robinow wrote:
>
> > Has it occurred to you that a better solution might be to fix your
> > software so that it works properly with text mounts?
>
> "No can do."
>
> Our software does, but third-party software it relies on and it is
> distributed with apparently does not. I already have about 20 lines of
> shell with gory sed's and the like to patch the source code of those
> third-party packages in case Cygwin is detected (I can't assume
"patch"
> is available), and I am *not* going to go through the source code of a
> bunch of external packages to fix all the possible problems there can
> be with text mounts. And before you ask, no, the people who develop
> those third-party packages won't fix them.
>
> It is much easier for me to tell people at installation time "DOS type
> detected, which is unsuitable, compile at your own risk" or to use
Max's
> suggestion and try to write a kludge that forces -lbinmode everywhere
if
> Cygwin is detected.
>
> Note that this stuff isn't even *supposed* to run under Windows, thank
> God (or to the Cygwin developers in that case) for small miracles.
>
> Anyway, thanks again for the tips, Max. Highly appreciated.


Could you just run a "dos2unix" (on non-binary files) in your
script?

Something like ...

   #!/bin/sh

   cat input_1.txt | tr -d '\r' > new_input_1.txt
   cat input_2.txt | tr -d '\r' > new_input_2.txt

   proceed();

... just wondering if it is a choice...

--Mark



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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