This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Direct/efficient way to chop off trailing \n
- From: Keith Christian <keith1christian at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 1 Oct 2014 16:56:51 -0600
- Subject: Re: Direct/efficient way to chop off trailing \n
- Authentication-results: sourceware.org; auth=none
- References: <loom dot 20141001T235147-60 at post dot gmane dot org> <542C854D dot 3050001 at jhmg dot net> <CAFWoy7EuG5vr2=QvEL5Js5Zg8rNfmLbHUYOrmnEdZsJ2vGFSnQ at mail dot gmail dot com>
Looks like the cygpath line was broken in two, and the closing brace
isn't visibile when reading in Gmail.
Readers take note of that.
On Wed, Oct 1, 2014 at 4:54 PM, Keith Christian
<keith1christian@gmail.com> wrote:
> 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 <jhg@jhmg.net> 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