From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3604 invoked by alias); 23 Jul 2019 15:15:47 -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 3597 invoked by uid 89); 23 Jul 2019 15:15:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=Eliot, Moss, moss, eliot X-HELO: resqmta-po-02v.sys.comcast.net Received: from resqmta-po-02v.sys.comcast.net (HELO resqmta-po-02v.sys.comcast.net) (96.114.154.161) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Jul 2019 15:15:45 +0000 Received: from resomta-po-13v.sys.comcast.net ([96.114.154.237]) by resqmta-po-02v.sys.comcast.net with ESMTP id pu7NhpCEdkHCipwVzhdteJ; Tue, 23 Jul 2019 15:15:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1563894943; bh=KuUsi1m8jLVVL1eCmLyfejuBDoFdtB7Yi5s/Vlsb7/A=; h=Received:Received:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type; b=4KKVZI4JwWnaJ0L5T+I61Somdt5a5DrJvOPpZUSRUQoomU6oaobSGLQSBQZJnCUYb D7G2a9yFaOx6xoL/WjrV1AKA0xjgvKRwBeDb29iiRxqPnQWrn1KAYUZJzv7jJlQWyT 7jJ2lGkAN2LoJvnU8xJkRNQIFbOlC/jZDq1WKA1NbhGUCJYFNmBC4pT/ac/5Lpix+R 9KhsJbG6Wboj7sZnVClF9sqMLw3NlN9O/ydQ3BDULs+y9GBD5ZTx4xvptau5pAef2u D45Yrb/2WyTBrvXu13BMOfi5ZRqKKvGK5DN5spBHB0O+XDQ42UXZ6FPxEYDJTYmY5J 19HcHe2dwAx6w== Received: from AndyWork ([73.223.74.29]) by resomta-po-13v.sys.comcast.net with ESMTPA id pwVyhlgcyMBm8pwVyhZnEG; Tue, 23 Jul 2019 15:15:43 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgeduvddrjeekgdekjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvfhgjufffkfggtgfgofhtsehtjehgtddvtdejnecuhfhrohhmpedftehnugihucfjrghllhdfuceofhhigihpvghrthhishgvqdgtohhnshhulhhtihhnghestghomhgtrghsthdrnhgvtheqnecukfhppeejfedrvddvfedrjeegrddvleenucfrrghrrghmpehhvghloheptehnugihhghorhhkpdhinhgvthepjeefrddvvdefrdejgedrvdelpdhmrghilhhfrhhomhepfhhigihpvghrthhishgvqdgtohhnshhulhhtihhnghestghomhgtrghsthdrnhgvthdprhgtphhtthhopegthihgfihinhestgihghifihhnrdgtohhmpdhrtghpthhtohepmhhoshhssegtshdruhhmrghsshdrvgguuhenucevlhhushhtvghrufhiiigvpedt X-Xfinity-VMeta: sc=0;st=legit From: "Andy Hall" To: , References: <009e01d540c6$c1b11d50$451357f0$@comcast.net> In-Reply-To: Subject: RE: Join command fails to output fields on input file with DOS line endings. Date: Tue, 23 Jul 2019 15:15:00 -0000 Message-ID: <00a301d54169$7e0a3f70$7a1ebe50$@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00207.txt.bz2 > On 7/22/2019 12:59 PM, Eliot Moss wrote: > On 7/22/2019 12: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 > Right. But in this case, the last field of the first file contains a \r which completely mangles the output. But join appears to "work" if the lines of the second file are in DOS format. E.g. $ join <(echo col F1) <(echo col F2 | unix2dos) col F1 F2 -- 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