From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121900 invoked by alias); 23 Jul 2019 06:50:07 -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 121893 invoked by uid 89); 23 Jul 2019 06:50:07 -0000 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.1 spammy=Eliot, eliot, HTo:D*comcast.net, H*M:yandex X-HELO: forward106p.mail.yandex.net Received: from forward106p.mail.yandex.net (HELO forward106p.mail.yandex.net) (77.88.28.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Jul 2019 06:50:04 +0000 Received: from mxback18g.mail.yandex.net (mxback18g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:318]) by forward106p.mail.yandex.net (Yandex) with ESMTP id AEFF61C814FD; Tue, 23 Jul 2019 09:50:01 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback18g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2WxP3yCf2E-o1gWgbws; Tue, 23 Jul 2019 09:50:01 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1563864601; bh=nNNU6uTHppvTVIG80B+rk4mE1+DXJc/R/pqZfahewAs=; h=In-Reply-To:Subject:To:Reply-To:From:Message-ID:References:Date; b=RV5PM5Z/ob19QbiY0zWz8d99mzPjSXswsKP8OfH2r5iSMyde6BUE+Iz/goVoF/TXX cnIZ/eStESH/eVlPbUlQMEguKASyZF8Lo2q+9V1rq2HQ7fjreOd/XoLBD+ZLkUm0NY 4gVSGHp932pYKKnsJArzXvEZMVlUsFn1Cf1brNLE= Authentication-Results: mxback18g.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PWSmWKbwIG-o0qe7uiv; Tue, 23 Jul 2019 09:50:01 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Tue, 23 Jul 2019 06:49:59 -0000 Date: Tue, 23 Jul 2019 06:50:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <937822985.20190723094959@yandex.ru> To: "Andy Hall" , cygwin@cygwin.com Subject: Re: Join command fails to output fields on input file with DOS line endings. In-Reply-To: <009e01d540c6$c1b11d50$451357f0$@comcast.net> References: <009e01d540c6$c1b11d50$451357f0$@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00204.txt.bz2 Greetings, Andy Hall! > 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 This makes perfect sense and actually explains what you see. 1. ("col", "F1\r") & ("col", "F2") 2. ("col", "F1\r", "F2") 3. printing "col F1\r F2" 4. obvious result: "col F1", then \r place cursor at the beginning of the line, then " F2" overprints the line beginning. 5. observed result: " F2 F1" > OK > $ join <(echo col F1) <(echo col F2) > col F1 F2 As Eliot said, don't do that. -- With best regards, Andrey Repin Tuesday, July 23, 2019 9:45:05 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