From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87901 invoked by alias); 22 Jul 2019 19:58:49 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 87894 invoked by uid 89); 22 Jul 2019 19:58:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=hall, Hall, Join, lesson X-HELO: mailsrv.cs.umass.edu Received: from mailsrv.cs.umass.edu (HELO mailsrv.cs.umass.edu) (128.119.240.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Jul 2019 19:58:47 +0000 Received: from [192.168.0.15] (c-24-62-203-86.hsd1.ma.comcast.net [24.62.203.86]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id 2CF174043A6F; Mon, 22 Jul 2019 15:58:46 -0400 (EDT) Reply-To: moss@cs.umass.edu Subject: Re: Join command fails to output fields on input file with DOS line endings. To: cygwin@cygwin.com References: <009e01d540c6$c1b11d50$451357f0$@comcast.net> From: Eliot Moss Message-ID: Date: Mon, 22 Jul 2019 19:58:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <009e01d540c6$c1b11d50$451357f0$@comcast.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00172.txt.bz2 On 7/22/2019 3:50 PM, Andy Hall wrote: > This behavior of join surprised me: > > $ join -1 3 <(echo a b col3 c d | unix2dos) <(echo col3 f2 f3 f4 f5) > f2 f3 f4 f5 > > Join parses the input line well enough to execute the join, but the presence of the DOS line endings suppresses the > output of fields from the first input. > > Compare with > > $ join -1 3 <(echo a b col3 c d) <(echo col3 f2 f3 f4 f5) > col3 a b c d f2 f3 f4 f5 > > which is correct. > > Here is a weirder example where the join field is missing and the output is reversed! > > NOK > $ join <(echo col F1 | unix2dos) <(echo col F2) > F2 F1 > > OK > $ join <(echo col F1) <(echo col F2) > col F1 F2 The lesson is: You're better off not using DOS line endings with Cygwin. It tends to do things the POSIX way, where the line ending is LF, not CR LF. Some things *may* work, but it's somewhat hit or miss ... EM -- 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