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:date:from:to:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; q=dns; s=default; b=pIgBzXYyo1aYFRGM6p9uPvoOpuNnid gtSCAv7relBN0ws4F95J6EW6Yb8Dfu36iaoLY7L5+3kVZltIqqKg8lx3Guf0cMmi VM8snyg+xfYJXDqHgpiiVsir5wzaXALyOloyuyeknNBCb8uPMYrzhUfQAyBC/B31 16wPQMByQYj/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:date:from:to:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=default; bh=3tcqIS+nYlWzoDXXBhkFtTivNsk=; b=TUGR ebiGuzN/DLfo4R82mgIAYLOsW+Zdik4SuErZ4DhsTFuDJv+f6IdQVWphCMLhoOyV +qokZErGkGzhNIC3LBoOqveajauAQ2e7D82cydCLhhy/CFRkSMwUoyGkY1HisCPy BKfy8+R6odHoZY0H29+yYHJMpegaoUOAE35ueGE= 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-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f54.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=2thOpYvtRRVtO946TLnyV4yIL5boW1BkSdO3PjGaP3U=; b=iEaG6D8WJIFv8B/GKSe4eiWq3sFX4eI2tXWyYOmBon9/vU815htmE2Q13F5hlA0o1v Xmx4vD2kgdPjr8Wtweb4s1mj9rYfLDvkKRwL8o0kxjESW3txpnD2fTLALckVXyzUD8Ol SQh8PpC3IPhnpoGakK/rkvwY/VPIydC76xZfk/cMxo8kUErvDcr9uT3zHyAmqvg/HuJ9 9hooZgjtXxDOs/5IFICJnAywZ1TVvLUwDqmbr96eqDMtVmICTE+lWTbLgiyywg8+DAvl e4Z7rumqADiWIppS5k92GRYKJ9KhHNgTUOEemHHhajt/wgEu/DAc2bpEdOpcSTbgtWp5 kgfQ== X-Gm-Message-State: ALoCoQnODylXqs5z6C1uBrqRaUI/crzbGrRgoyQfUDFY5QTr1uTwxixSUGwhptv0n4Fqz+Y+emw1 X-Received: by 10.180.205.210 with SMTP id li18mr8361327wic.39.1423763177378; Thu, 12 Feb 2015 09:46:17 -0800 (PST) Date: Thu, 12 Feb 2015 17:46:15 +0000 From: Adam Dinwoodie To: cygwin AT cygwin DOT com Subject: Re: Writing to /dev/clipboard from multiple processes in Bash gives inconsistent behaviour Message-ID: <20150212174615.GD20741@dinwoodie.org> References: <20150212134550 DOT GC20741 AT dinwoodie DOT org> <20150212170342 DOT GB7818 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150212170342.GB7818@calimero.vinschen.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes On Thu, Feb 12, 2015 at 06:03:42PM +0100, Corinna Vinschen wrote: > On Feb 12 13:45, Adam Dinwoodie wrote: > > I've spotted some slightly odd behaviour when writing things from > > multiple processes to /dev/clipboard. > > > > Easiest to show this with an example: > > > > for n in {1..10}; do echo $n; done >/dev/clipboard; cat /dev/clipboard > > > > I expect this to print out the numbers 1–10 to the terminal. Sometimes > > it does, but sometimes it misses out some of the numbers at the end; > > printing the digits 1–8, say, but no more. Generally it gets to around > > 7–9, but I've seen it managing to only get up to 3 on one occasion. > > I can't reproduce this. First I tried this manually a couple of times, > but then I created a loop: > > for i in {1..1000} > do > echo > /dev/clipboard > for n in {1..10}; do echo $n; done > /dev/clipboard > grep -q 10 /dev/clipboard || cat /dev/clipboard > done > > and it didn't fail once. I'm not sure what to do if I don't have a > reproducible testcase... Huh, I had expected this to be trivially reproducible. I just ran a slight variation of your loop with a counter, and didn't get the full list in 668 of the 1000 iterations, so it's definitely reproducible here. I'll do a little more digging locally and see if I can't isolate the problem further. -- 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