From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114284 invoked by alias); 18 Aug 2018 14:17:52 -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 114263 invoked by uid 89); 18 Aug 2018 14:17:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:HHHHHH, HX-HELO:sk:sonic31, H*UA:x64, utm_content X-HELO: sonic314-20.consmr.mail.ne1.yahoo.com Received: from sonic314-20.consmr.mail.ne1.yahoo.com (HELO sonic314-20.consmr.mail.ne1.yahoo.com) (66.163.189.146) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 Aug 2018 14:17:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1534601867; bh=kYzOj1w0x2ew9aFoegQB8Suo7eE5qPXdLvF3QqtxUxA=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=Nwe2Os39/vcrdt6YDSP+/Ba26NUJ6Zwg5qufoIqIChX0NlgdH59ov8PG9uGqxv+H2lhiM6s2kUjp/+xdYkd6vVw50yJA2TZn2QEm7KbjjHfzGtS13mJghI4q3nzlPzld7zZTkHOe3q3fyZx7UagSbmgRlB8IHyNAObLOJ8l9wSkxWJwxFku00zSca5aC+P2kreMCr2KUf5moQU6WauEVNl/0XwRfi15jfrTxILGwej12rgqY71pEJhwIehlbeQCjmDrUwLpcs2zKxecwTPldzUATtZb7o4DPP+FvB7VSwnmuWVeKQ+sBE6efzHq/9aSckXob5fufjoxWm5P17Yo70A== Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sat, 18 Aug 2018 14:17:47 +0000 Date: Sat, 18 Aug 2018 17:01:00 -0000 From: "Donald Krieger via cygwin" Reply-To: Donald Krieger Reply-To: Donald Krieger To: "moss@cs.umass.edu" , "cygwin@cygwin.com" Message-ID: <625442829.188518.1534601860831@mail.yahoo.com> In-Reply-To: References: <1925552125.164706.1534595788839.ref@mail.yahoo.com> <1925552125.164706.1534595788839@mail.yahoo.com> Subject: Re: stdbuf does not work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00250.txt.bz2 Dear Eliot, Thanks for getting back so quickly.Program1 is a windows routine, xgraph.= =C2=A0=C2=A0http://www.xgraph.org/ms/index.htmlThis is a general purpose pl= otting program which writes out text whenever an operation is performed in = its graphic window. That text output is piped into Program2, a home-grown tcsh script.Program2 = reads the xgraph text output one line at a time and uses it to update the d= isplay list files which xgraph is polling to keep its graphic window up to = date. Here is the test harness I'm executing inside a cygwin window. For test pur= poses, Program2 is cat.=C2=A0 =C2=A0stdbuf -oL -eL xgraph | cat -A Here's a typical output which is only seen once I've terminated xgraph by c= licking the appropriate button in the graphic window. The only think I did = while xgraph was running was click at one location in the graphics window; = that's what generated the line: Clicked at (x,y) =3D (-0.62324, 0.255608) XGraph v4.38^M$Window (800 x 594)^M$0 points read.^M$^M$Error:=C2=A0 No dim= ensional data was read.=C2=A0 Cannot determine axes ranges.^M$^M$=C2=A0 =C2= =A0Clicked at (x,y) =3D (-0.62324, 0.255608)^M$Exiting XGraph.^M$ I tried 0 (zero) instead of L in the stdbuf switches just because.I also tr= ied using stdbuf -i0 Program2in case that might make a difference. I can easily eliminate the :=C2=A0 stdbuf -oL -eL xgraph | tr -d "\015"= | cat -AThis produces the same output but with the ^M 's removed.I don't k= now how to alter the windows line endings but would like to. Thanks again and for any further thoughts. Best - Don From: Eliot Moss To: cygwin@cygwin.com=20 Sent: Saturday, August 18, 2018 9:14 AM Subject: Re: stdbuf does not work =20=20=20 On 8/18/2018 8:36 AM, Donald Krieger via cygwin wrote: > Dear list, > I require line buffered output from program1 and line buffered input to p= rogram2.The following works under Linux but not under Cygwin.=C2=A0 =C2=A0s= tdbuf -oL -eL program 1 |& program2 >=20 > I've searched the archive without success.I have tried -o0 -e0 -i0 and ha= ve also tried >=C2=A0 =C2=A0 stdbuf -oL -eL program1 |& stdbuf -i0 program2 > I have a fresh installation of cygwin as of a few months ago:=C2=A0 uname= -a=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 yields:CYGWIN_NT-10.0 D= ESKTOP-S92525R 2.10.0(0.325/5/3) 2018-02-02 15:16 x86_64 Cygwin >=C2=A0 =C2=A0 stdbuf --version=C2=A0 =C2=A0 yields:stdbuf (GNU coreutils) = 8.26Packaged by Cygwin (8.26-2)Copyright (C) 2016 Free Software Foundation,= Inc.... Some thoughts to consider: - -i0 means unbuffered; did you write the wrong description above? - As noted in the strbuf man page, some programs don't use streams and thus= are =C2=A0 not affected by strbuf settings.=C2=A0 I agree this is not something= likely to =C2=A0 change for the same program ported from Linux to Cygwin. - How do you have line endings set up on Cygwin or in any files you are =C2=A0 processing?=C2=A0 The usual Windows line ending=C2=A0 being CR-LF in= stead of Linux's =C2=A0 LF can confuse some programs. It might also help potential responders to know a little more about what pr= ogram1 and program2 are.=C2=A0 Are they Windows or Cygwin programs? Regards - EM -- Problem reports:=C2=A0 =C2=A0 =C2=A0 http://cygwin.com/problems.html FAQ:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 http://c= ygwin.com/faq/ Documentation:=C2=A0 =C2=A0 =C2=A0 =C2=A0 http://cygwin.com/docs.html Unsubscribe info:=C2=A0 =C2=A0 =C2=A0 http://cygwin.com/ml/#unsubscribe-sim= ple =20=20=20 | | Virus-free. www.avast.com | -- 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