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:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; q=dns; s=default; b=fwQvT0qbnBgn6q2SUsfOAl0BvOqHH YxmSptatEQMGe8OHJvB4hYAfiprAe/Lh7I6ahC24Ct/rQjPLuXlZKCuXxPFdHOEH CJHeRjcmskf7N39zVQiVhuWJHcboMgJYdBjGqIEw12l7Ud98fPZa1/FUjAwMgYN1 P6QTXpoOV7c5PE= 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:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; s=default; bh=XIy5ZJkoS5/hPiqK5prczMk06PQ=; b=gdc BbH5RouHJACTK3GTpUZhEE7AGGo3kMseyOlnP70Eu7vLqbGX9DZKvjaJpcrNnjMq 2tvQWwtyF+gEV9Dp016+YnJC6+qC2pGu5muetY2yh6PrUZPCIa4mniKGLXR5mk4b 9ZD+bozFQ/BvcExtu9rkkUCJ6ndd8rlBgY/E/mik= 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=-1.8 required=5.0 tests=AWL,BAYES_05,MIME_BASE64_BLANKS,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: nihtlsxway4.hub.nih.gov X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmQOALNOLVScKEew/2dsb2JhbABggw+BMIJ+zA+DIQIZcBYBA28JhAQBAQQSERFVAgEIDQsCAgYgAgICHRMVAgENAgQbEweIHJx3iiqWBQEXgSyOSRYigng2gR0FkW0Dk0SNcoNjgjSBAgEBAQ X-IPAS-Result: AmQOALNOLVScKEew/2dsb2JhbABggw+BMIJ+zA+DIQIZcBYBA28JhAQBAQQSERFVAgEIDQsCAgYgAgICHRMVAgENAgQbEweIHJx3iiqWBQEXgSyOSRYigng2gR0FkW0Dk0SNcoNjgjSBAgEBAQ From: "Buchbinder, Barry (NIH/NIAID) [E]" To: "cygwin AT cygwin DOT com" Subject: RE: Direct/efficient way to chop off trailing \n Date: Thu, 2 Oct 2014 13:12:11 +0000 Message-ID: <6CF2FC1279D0844C9357664DC5A08BA20EC1B6C8@MLBXV06.nih.gov> References: <1576090815 DOT 20141002032152 AT yandex DOT ru> <542CB798 DOT 8000800 AT cs DOT umass DOT edu> <542CB963 DOT 4010004 AT redhat DOT com> In-Reply-To: <542CB963.4010004@redhat.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id s92DDW3A014313 Eric Blake sent the following at Wednesday, October 01, 2014 10:33 PM >On 10/01/2014 08:25 PM, Eliot Moss wrote: > >> You could write my solution as: >> >> echo -n `cygpath -aw foo`>/dev/clipboard > >'echo -n' is not portable (in fact, you can disable it in bash, and it >may misbehave if cygpath outputs a leading - or contains any \); it's >better to use 'printf' for that purpose: > >printf %s `cygpath -aw foo`>/dev/clipboard > >> The echo solution has the good property that echo is >> a shell built-in and so does not require spawning >> another process. > >The same is true of printf. Converting \n line endings to \r\n might work for you when you paste into a Windows app. It does for me. cygpath -aw foo/bar | putclip -d - Barry Disclaimer: Statements made herein are not made on behalf of NIAID.