From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-xforward.gmx.com (mout-xforward.gmx.com [82.165.159.130]) by sourceware.org (Postfix) with ESMTPS id 404BB3858C3A for ; Tue, 11 Apr 2023 07:15:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 404BB3858C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=royal.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=royal.net Received: from [178.140.144.219] ([178.140.144.219]) by web-mail.mail.com (3c-app-mailcom-lxa08.server.lan [10.76.45.9]) (via HTTP); Tue, 11 Apr 2023 09:15:03 +0200 MIME-Version: 1.0 Message-ID: From: Leonid Mironov To: "cygwincygwin.com" Subject: issue when piping from a windows program Content-Type: text/plain; charset=UTF-8 Date: Tue, 11 Apr 2023 09:15:03 +0200 Importance: normal Sensitivity: Normal Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-Provags-ID: V03:K1:d+U4p5xE/JpmzFzWia3OCM0aUML1/jE8VSAI99VWJd3HVOoIt4e7kc3Hbvr53hOV8gal/ IICLMRU7J0cEZ523b+a34rUZhp8WQBex6BdNhPllE0/opOcf92Il2dtvslvXpuTOpYH2rwADZvBC d2NKwdQ5+dUfNXZ1hWtRnIlpidj4nLxa/yxLuNNhJCAG2bpVD4aNlj3dUQjdUc62l80d9YAG44tq G4GonqaYBCCPYtf+Oj2xb5GHquzPJa63X32LQMYB8bYv8t7CNQ/sAoUVVZ/DFeOx9IMkYZhWorrm Sg= UI-OutboundReport: junk:10;M01:P0:DRsXoVVtVGA=;6T6hwZo3XHoNmLqlAjH41j9DAsF3e JN/8cIx4UEFRteneZtEK75BQB3NVOSx5ryw/SiLQZjQljpmcXO3/7vgpYpjxVYlZ28cwUMgb5 CKhA2XHpNJbcshXC8y/jzXZq77q6r/geBGrtpoeRWegBEa0DzUquW/C/GN1eZ3q+5D7nL+irv rkIt1Pxz74lWAM4q/lJj/exdEMsQ87HfbPWVwJipTvbzYXfgGKqZtyTjD1c++lauO/xRFx8xB b/6IaMq1yyMt4qZBNr6P/xsxwzLbHHgk2zAwL5fxm9AfCdKldqDlNzDpEX3iHMyhhSYbNQ2M8 vUdpVU1LxVrUipY2YdWybXVcSncXraicUupLUJMeGhRVyY6codZfem22vZ7nbkUYeMFPs3oup o9pa8TIxG5R0JetaCMvlVIKijkKrRdOzYxXfqbR8tLQ/nNhYVbykWpclm94b4q1Elq+5X6wXI i8q0QRcQ2p0UsOl/AiIjfnfky7RrrbUsXU9lkaNEFZlSLqmEHRnUMJb/Y1Ynj9Uw7WDcSL9xH AoOqKzd5QlsWXalcdi49XUMmvlXc+xPDsCwHnsJ7M/bTe1+5ZSVsJvbvvlsd1CTJd+4jRwibt LWwDzXEEv15iJYC/J5UhHEPAzzR2dvLzrQZ6KSAspjOQiKuGNhNrjpGEs6vjF/rQEm+0v0LK0 ArPhTZPwz8LtPMINFdahi+s9WhffqYMx4XBBK5i+Ukm5sgxyPRQUbf3/0nHZswLZNGKbUtr2C yEtx6zZYpIyfSwiNYYNLuAo+e5hu5KH1qz/EExczR8vb09ERwOFjkBa1PKDRjpIE+Wfgnsp8a iRbHusRwS98xZqDGZGFcjp2PDiqZE/TeyOgY0pkQvyTmf+njZnyUVsMsl2wSifxm X-Spam-Status: No, score=3.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM,KAM_DMARC_STATUS,RCVD_IN_PSBL,RCVD_IN_SBL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I am trying to feed the output of wmic=2Eexe - a windows console program, t= o cygwin bash script=2E=20 wmic=2Eexe produces UTF16LE output with BOM and CR/LFs, so I am using dos2= unix to convert it=2E=20 The problem is that when I write wmic=2Eexe output to a file and then use = dos2unix to convert this file=20 I get the expected result - ASCII file with LFs, I get the same result whe= n I pipe this file to dos2unix,=20 but when I pipe wmic=2Eexe output directly to dos2unix I get ASCII file wi= th CR/LFs and an extra empty line=2E=20 Cygwin is up to date, windows 10=2E What gives? Here are the hexdumps of 'wmic /NAMESPACE:\\\\root\\WMI PATH BatteryStatus get charging,voltage,= remainingcapacity,chargerate>file' 00000000 ff fe 43 00 68 00 61 00 72 00 67 00 65 00 52 00 |=2E=2EC=2Eh= =2Ea=2Er=2Eg=2Ee=2ER=2E| 00000010 61 00 74 00 65 00 20 00 20 00 43 00 68 00 61 00 |a=2Et=2Ee=2E = =2E =2EC=2Eh=2Ea=2E| 00000020 72 00 67 00 69 00 6e 00 67 00 20 00 20 00 52 00 |r=2Eg=2Ei=2En= =2Eg=2E =2E =2ER=2E| 00000030 65 00 6d 00 61 00 69 00 6e 00 69 00 6e 00 67 00 |e=2Em=2Ea=2Ei= =2En=2Ei=2En=2Eg=2E| 00000040 43 00 61 00 70 00 61 00 63 00 69 00 74 00 79 00 |C=2Ea=2Ep=2Ea= =2Ec=2Ei=2Et=2Ey=2E| 00000050 20 00 20 00 56 00 6f 00 6c 00 74 00 61 00 67 00 | =2E =2EV=2Eo= =2El=2Et=2Ea=2Eg=2E| 00000060 65 00 20 00 20 00 0d 00 0a 00 30 00 20 00 20 00 |e=2E =2E =2E= =2E=2E=2E=2E0=2E =2E =2E| 00000070 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 | =2E =2E =2E = =2E =2E =2E =2E =2E| 00000080 20 00 46 00 41 00 4c 00 53 00 45 00 20 00 20 00 | =2EF=2EA=2EL= =2ES=2EE=2E =2E =2E| 00000090 20 00 20 00 20 00 33 00 37 00 37 00 33 00 34 00 | =2E =2E =2E3= =2E7=2E7=2E3=2E4=2E| 000000a0 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 | =2E =2E =2E = =2E =2E =2E =2E =2E| 000000b0 20 00 20 00 20 00 20 00 20 00 20 00 31 00 32 00 | =2E =2E =2E = =2E =2E =2E1=2E2=2E| 000000c0 37 00 34 00 30 00 20 00 20 00 20 00 20 00 0d 00 |7=2E4=2E0=2E = =2E =2E =2E =2E=2E=2E| 000000d0 0a 00 |=2E=2E| 000000d2 of wimic>file followed by dos2unix