Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Authentication-Warning: arachnion.cs.Virginia.EDU: nc2y owned process doing -bs
Date: Thu, 6 Feb 2003 11:13:24 -0500 (EST)
From: Nicolas Christin <nicolas@cs.virginia.edu>
X-X-Sender: nc2y@arachnion.cs.Virginia.EDU
To: Max Bowsher <maxb@ukf.net>
cc: cygwin@cygwin.com
Subject: Re: Detecting text type in a shell script
In-Reply-To: <00e101c2cdf8$79490fd0$78d96f83@pomello>
Message-ID: <Pine.GSO.4.53.0302061104010.1132@arachnion.cs.Virginia.EDU>
References: <Pine.GSO.4.53.0302061048490.1087@arachnion.cs.Virginia.EDU>
 <00e101c2cdf8$79490fd0$78d96f83@pomello>
Organization: University of Virginia - CS Dept.
X-No-Archive: no
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Thu, 6 Feb 2003, Max Bowsher wrote:

> Nicolas Christin wrote:
> >
> > How can I detect what text type was chosen at install time? (So that I
> > can appropriately set/unset my cygwin-unix-type variable.)
>
> man mount

Max, thanks.

OK... I had actually checked that, but it didn't come to me as
straightforward how to use it for my particular problem. Can I just
assume that if I don't see any "textmode" field in the mount table, then
everything is fine?

More specifically, does something of the kind:

#!/bin/sh
# test we're in binmode

mount | grep textmode >/dev/null 2>&1

if [ "$?" -eq "0" ]; then
        # found text modes - probably bad
        bail();
else
        proceed();
fi;

would do? (I don't have a DOS-type installed Cygwin available at the
moment, so I'm doing this blind and can't test it...)

Thanks again,
-- 
Nicolas

--
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/

