delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/04/11/10:51:08

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD17C3858410
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1681224621;
bh=Htd1hPQ/sLUv29eunUVB2NJjY019uO2Rzsiae1sJLNg=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=b67EP3VV+msBCRj0B4Ru4EQ70CDpXSjb0DxRMYlppvIaPgpF8UV+mSZk3qjAzVLqi
KmAAL32wQgycZ4jqKz7SmtmtwWvb2DF3+WzT29F8hQQu3nN2m/705bGdXtiV2xHKmt
dcEWTrbdqF9hy7TqoD2Uy9Qa0VKcfEJbineKrpLo=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 458D33858D28
X-Yandex-Fwd: 1
Date: Tue, 11 Apr 2023 17:43:22 +0300
X-Mailer: The Bat! (v9.3.4) Professional
Message-ID: <1138153048.20230411174322@yandex.ru>
To: Leonid Mironov <lvm AT royal DOT net>, cygwin AT cygwin DOT com
Subject: Re: issue when piping from a windows program
In-Reply-To: <trinity-bed8517a-5458-4f9d-8ee1-6d6698fcdea7-1681197303539@3c-app-mailcom-lxa08>
References: <trinity-bed8517a-5458-4f9d-8ee1-6d6698fcdea7-1681197303539 AT 3c-app-mailcom-lxa08>
MIME-Version: 1.0
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT,
NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Andrey Repin via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Andrey Repin <anrdaemon AT yandex DOT ru>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 33BEokmv005508

Greetings, Leonid Mironov!

> I am trying to feed the output of wmic.exe - a windows console program, to cygwin bash script.
> wmic.exe produces UTF16LE output with BOM and CR/LFs, so I am using dos2unix to convert it.
> The problem is that when I write wmic.exe output to a file and then use dos2unix to convert this file
> I get the expected result - ASCII file with LFs, I get the same result when I pipe this file to dos2unix,
> but when I pipe wmic.exe output directly to dos2unix I get ASCII file with CR/LFs and an extra empty line.
> Cygwin is up to date, windows 10. What gives?

You don't need d2u. Use `… | iconv -f UTF16LE | tr -d '\r'`
(Don't even need -t for iconv - it assumes current locale settings as
default source/destination encoding.)


-- 
With best regards,
Andrey Repin
Tuesday, April 11, 2023 17:41:32

Sorry for my terrible english...

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019