X-Recipient: archive-cygwin@delorie.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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=USoZ7SDI/iz1JRyS
	7jVsUAVdwjQYNGXVI76VR+Fi20dGpLfdvwF7s9Rf8oxHlveyOp5f8dt23QtS22ph
	gvGfJjJf/wkppJVyRVHDoVl6z/3MHcW6kLWs2GDPyumlA/X4hXqSLym4yLJabRLP
	Xx/7TSVTO38IIVC4SOZrNtVMyGQ=
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:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=93YSOmMBfjxz+7HvZI6A+X
	LVsis=; b=b8R3iIMdOTDua7ev6rAO6aiiXYk1Wyb1bukpl0kw9iMw8z94fwV1xN
	3t/KYV3Lokp9DuD+1jZDOG0YjiXAKZWWDOKHIIaiTKqXHe9LHNwsawfX0oxmSFFU
	o9HiAfGrtDJ0AH2P+gF6BIAa5otosz1HyEyN2uKERWNIU0+MBrRBE=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=english, HX-Priority:Normal, yandexru, UD:yandex.ru
X-HELO: forward102p.mail.yandex.net
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1550256601;	bh=VTpi1jfvOUXMgUcSoZJQH7DYIHzYlb7A0jpth1/1X8c=;	h=Date:From:Reply-To:Message-ID:To:Subject:In-Reply-To:References;	b=o49M2a9kVcoVzjk2wX782Yc+dYZ3UYjMqU5d1NUzV78qfjVFtM5txHcBIjBHCtheW	 c2IrOG6Gu8xLf2qFYhVHGDnaVcZY9PlrjGfkV0O5a09Rq1Q5IWR3MjTAqsytd0Nwi+	 tZMdMlPO257L4igQ7hfwiZRtrT6ioESkfSIcPtPk=
Authentication-Results: mxback23g.mail.yandex.net; dkim=pass header.i=@yandex.ru
Date: Fri, 15 Feb 2019 21:35:42 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <1787080198.20190215213542@yandex.ru>
To: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>,
        cygwin@cygwin.com
Subject: Re: portable use of dos2unix WAS: Re: textmode for stdout, what is "correct" now?
In-Reply-To: <d59689ee-4bf3-d66f-ca0b-f9cec8dda035@ssi-schaefer.com>
References: <739ed5ce-6902-d702-e152-65dc2c1da667@ssi-schaefer.com>   <20190214162002.GA4950@calimero.vinschen.de>  <6aa280c2-4769-0772-91d9-c73a3a3d9680@ssi-schaefer.com>  <20190215102251.GA2702@calimero.vinschen.de>  <f7345109-5b22-a342-df1e-940e236c2397@ssi-schaefer.com>  <1282767785.20190215154502@yandex.ru>  <d59689ee-4bf3-d66f-ca0b-f9cec8dda035@ssi-schaefer.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Michael Haubenwallner!

> On 2/15/19 1:45 PM, Andrey Repin wrote:
>> Greetings, Michael Haubenwallner!
>> 
>>>>
>>>> For scripting, d2u should help.
>> 
>>> Plus, to be portable: type d2u >/dev/null 2>&1 || d2u() { cat; }
>> 
>> _d2u="$( which d2u 2> /dev/null || echo cat )"

> To be honest, this is less portable for some reasons:

> * "$(...)" is not Bourne Shell (/bin/sh) but POSIX Shell (ksh, bash, ...)

And /bin/sh is a POSIX shell. I don't know what you are trying to say here.
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html#tag_20_117
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_03

> * "which" is C Shell and has it's own troubles (may load ~/.cshrc first)

$ which which
/bin/which

It's a separate executable, unless shell provides an override.
How it could possible load foreign RC file is beyond me.

----

I have a different question though. The commands you presented in the OP
look like you aren't using Cygwin-suppied OpenSSL binary.


-- 
With best regards,
Andrey Repin
Friday, February 15, 2019 21:28:57

Sorry for my terrible english...


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

