X-Recipient: archive-cygwin@delorie.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:message-id:date:from:reply-to:mime-version:to
	:subject:references:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=Qq4xRT+j+kYIDbAb
	94fO0RPACxwzIIlj2mCin6N4NkAcwRIDw6pZFyy1ml9v0GWdmmqTu3lqnX7vkz79
	WnCvt6oHn66jU5HOo2ErO4BVg4+vyT43qre/Fx/bf12ChDfjWJIpy2l5EWODCc51
	mxcSvOsrjXT/pfZfpwX1DRrdYJc=
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:message-id:date:from:reply-to:mime-version:to
	:subject:references:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=vUTIddbKFFr/ZloDmDk8wy
	aN6II=; b=QNi4W3LZeyKWCR6ZIqY/21OWo4bzT4qhxg0a/32RNeGvzp1ARse3TU
	getzsMxnV+g2I5d0fhlIngG8SdknwmM9G3HP4PHAZUohLzxf7P68wNGtw/BNj2I7
	g/hsItQRrEYzYxQCKbpMpzcDvC8IeWUGCt3TEDxXa/mcGYrmbkfI0=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: csmail.cs.umass.edu
Message-ID: <542CB798.8000800@cs.umass.edu>
Date: Wed, 01 Oct 2014 22:25:28 -0400
From: Eliot Moss <moss@cs.umass.edu>
Reply-To: moss@cs.umass.edu
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Direct/efficient way to chop off trailing \n
References: <loom.20141001T235147-60@post.gmane.org> <loom.20141002T011040-272@post.gmane.org> <1576090815.20141002032152@yandex.ru>
In-Reply-To: <1576090815.20141002032152@yandex.ru>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

You could write my solution as:

echo -n `cygpath -aw foo`>/dev/clipboard

though the ` (backtick) notation is deprecated these
days and $(...) is described as preferred.  But for many
little things like these I write bash functions (or
aliases, when they work, which they don't here).

The echo solution has the good property that echo is
a shell built-in and so does not require spawning
another process.  You had complained about speed, so
even though the echo approach does not seem to top
you list for elegance, it might for performance :-) ...

Best -- Eliot

--
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

