From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4251 invoked by alias); 1 Oct 2014 21:52:34 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 4241 invoked by uid 89); 1 Oct 2014 21:52:34 -0000 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 Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 01 Oct 2014 21:52:32 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XZRoz-0005EE-Ay for cygwin@cygwin.com; Wed, 01 Oct 2014 23:52:29 +0200 Received: from fw.drenet.dnd.ca ([131.136.242.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Oct 2014 23:52:29 +0200 Received: from Paul.Domaskis by fw.drenet.dnd.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Oct 2014 23:52:29 +0200 To: cygwin@cygwin.com From: Paul.Domaskis Subject: Direct/efficient way to chop off trailing \n Date: Wed, 01 Oct 2014 21:52:00 -0000 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 X-SW-Source: 2014-10/txt/msg00012.txt.bz2 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