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:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=RZc SMclBE7LVLdAwIKzuvwciiMCXwOjmEYWnRzqxJASg4GfKob5LFP9EPjtK+F/wuwm 7eM4PXtZ6QjNYWNGqCSIvJc5VrSrBuEEL2i4ovZnORMSwrjkVhN38nUjg7eepdc3 2U6VrqnJWsjpgIasEqRVjTHo1ZCL8nsR/+HiIQ4Y= 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:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=j0m/0sRMr vXpsCXYY4eXBQ0DBs0=; b=T00NXVZwzuhVlPcKR3nqBC06fh/iUlh0UAxBxTjYT 3yNunlZdzRHFmtfBHGmeyurKwhUNWNAgzjF08TBkO/6c8nRGIFg5ILfNRohHeQEx j2a+UWtAHsDDGiT8VTWEmQWFgffNbKH3bpcEonftAruUWxzJIGeVENhbPWrf7IXY KM= 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.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: "Paul.Domaskis" Subject: Direct/efficient way to chop off trailing \n Date: Wed, 1 Oct 2014 21:52:10 +0000 (UTC) Lines: 26 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Running bash in a Windows environment, I often find the need to generate a full Windows path to a file so that I can access the file from a Windows app. If I use cygpath -aw TheFile > /dev/clipboard I can paste into the Windows file-opener without browsing. Also, I don't need to mouse around to highlight the result of cygpath. However, the clipboard always contains an invisible carriage return, which I have to remove by pressing backspacing. This doesn't visibly change anything, but it does remove the trailing \n which chokes up Windows. Since I hate manually deleting stuff that I can't see, the most efficient way around this seems to be: cygpath -aw | tr -d '\n' > /dev/clipboard This is starting to get longer and longer. It is comprising the whole goal of getting a sequence of operations that is so brief that one does not sigh at having to do it countless times. Is there a more succinct way to get a clean path for a file from the bash shell into the Windows clipboard? -- 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