From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22318 invoked by alias); 1 Oct 2014 22:54:49 -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 22309 invoked by uid 89); 1 Oct 2014 22:54:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f179.google.com Received: from mail-ig0-f179.google.com (HELO mail-ig0-f179.google.com) (209.85.213.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 01 Oct 2014 22:54:47 +0000 Received: by mail-ig0-f179.google.com with SMTP id h18so1359077igc.6 for ; Wed, 01 Oct 2014 15:54:44 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.42.188.70 with SMTP id cz6mr202369icb.19.1412204084597; Wed, 01 Oct 2014 15:54:44 -0700 (PDT) Received: by 10.50.224.164 with HTTP; Wed, 1 Oct 2014 15:54:44 -0700 (PDT) In-Reply-To: <542C854D.3050001@jhmg.net> References: <542C854D.3050001@jhmg.net> Date: Wed, 01 Oct 2014 22:54:00 -0000 Message-ID: Subject: Re: Direct/efficient way to chop off trailing \n From: Keith Christian To: jhg@acm.org, cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00015.txt.bz2 This function echoes the present directory to the clipboard, so that I don't have to enter the path manually. I use this function in a script that sources when a bash shell is started. Also echoes the path to the terminal for verification. Handy for pasting directly into windows file dialogs. function xx() { DESCRIPTION="Copy the Windows drive/path/filename to the clipboard" cygpath -w "`pwd`"|tr -d "\012"|sed -e 's/$/\\/'|putclip;echo;getclip;echo } On Wed, Oct 1, 2014 at 4:50 PM, Jim Garrison wrote: > On 10/1/2014 2:52 PM, Paul.Domaskis wrote: >> 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. > [snip] >>... but it does remove the trailing \n which chokes up >> Windows. > > Sounds like cygpath needs a "-n" option which eliminates the > trailing newline. > > > -- > Jim Garrison (jhg@acm.org) > PGP Keys at http://www.jhmg.net RSA 0x04B73B7F DH 0x70738D88 > > -- > 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 > -- 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