X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=Bhpq1mlCQPq4XOGz bRDV/4J5U5GLT09z/04Zi7PpKAk3eummqGTn6BSPlsGhRs40cLd6TY+GCEg/XSj8 +7W5ikMC+k7FZzzIxZgDPZPFawVG4U09VQpgD/AIsNIEJ6q3m35KLynK9Ojb681h DLSjVMTTS5DR7EbplwIRZGW9s/U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=n4STuEogV8olDNecZpEZZy XXG0A=; b=SmpTUa3GcLph/it6AuXrpLP0SvDq9r/kI2QwF4BTIf5PgCmxTFFsPu 0+h2ZCw6vb2zBA2y18o/kPTnDpnBK7VSlm29kMFTX3v76SXe3TONX62ZRVKsJiNE X01i5xHWX5UAHYRbw1jub49Mfk0QhFqlSpMvSU7/70X2YohVGo9R0= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2365 X-HELO: mailsrv.cs.umass.edu Reply-To: moss AT cs DOT umass DOT edu Subject: Re: stdbuf does not work To: cygwin AT cygwin DOT com References: <1925552125 DOT 164706 DOT 1534595788839 DOT ref AT mail DOT yahoo DOT com> <1925552125 DOT 164706 DOT 1534595788839 AT mail DOT yahoo DOT com> <625442829 DOT 188518 DOT 1534601860831 AT mail DOT yahoo DOT com> From: Eliot Moss Message-ID: Date: Sat, 18 Aug 2018 10:28:54 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <625442829.188518.1534601860831@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes On 8/18/2018 10:17 AM, Donald Krieger via cygwin wrote: > Dear Eliot, > Thanks for getting back so quickly.Program1 is a windows routine, xgraph.  http://www.xgraph.org/ms/index.htmlThis is a general purpose plotting 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 display 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 purposes, Program2 is cat.   stdbuf -oL -eL xgraph | cat -A > Here's a typical output which is only seen once I've terminated xgraph by clicking 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) = (-0.62324, 0.255608) > XGraph v4.38^M$Window (800 x 594)^M$0 points read.^M$^M$Error:  No dimensional data was read.  Cannot determine axes ranges.^M$^M$   Clicked at (x,y) = (-0.62324, 0.255608)^M$Exiting XGraph.^M$ > I tried 0 (zero) instead of L in the stdbuf switches just because.I also tried using stdbuf -i0 Program2in case that might make a difference. > I can easily eliminate the :  stdbuf -oL -eL xgraph | tr -d "\015" | cat -AThis produces the same output but with the ^M 's removed.I don't know how to alter the windows line endings but would like to. > Thanks again and for any further thoughts. Apparently stdbuf works by interposing stuff, via a loader PRELOAD technique, before main in the program being run. I suspect this simply does not work when applied to Windows programs, though I cannot say for sure. What about this: xgraph ... | strbuf -oL -eL tr -d '\015' | ... That is, apply strbuf to tr, which is a Cygwin program. You could even apply it to cat. Alternatively, if the xgraph of which you speak is this: https://sourceforge.net/projects/nsnam/files/xgraph/xgraph-12.1/ you might be able to re-build it under Cygwin, though doing so sometimes requires some adjustments to a program or its build process (though a number of programs build out-of-the-box pretty well). Clearly this is hardr than trying the suggestion above :-) ... Regards - EM -- 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