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: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 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=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 Reply-To: moss AT cs DOT umass DOT 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 AT cygwin DOT com Subject: Re: Direct/efficient way to chop off trailing \n References: <1576090815 DOT 20141002032152 AT yandex DOT 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