public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder@niaid.nih.gov>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: Direct/efficient way to chop off trailing \n
Date: Thu, 02 Oct 2014 13:13:00 -0000	[thread overview]
Message-ID: <6CF2FC1279D0844C9357664DC5A08BA20EC1B6C8@MLBXV06.nih.gov> (raw)
In-Reply-To: <542CB963.4010004@redhat.com>

Eric Blake sent the following at Wednesday, October 01, 2014 10:33 PM
>On 10/01/2014 08:25 PM, Eliot Moss wrote:
>
>> You could write my solution as:
>>
>> echo -n `cygpath -aw foo`>/dev/clipboard
>
>'echo -n' is not portable (in fact, you can disable it in bash, and it
>may misbehave if cygpath outputs a leading - or contains any \); it's
>better to use 'printf' for that purpose:
>
>printf %s `cygpath -aw foo`>/dev/clipboard
>
>> The echo solution has the good property that echo is
>> a shell built-in and so does not require spawning
>> another process.
>
>The same is true of printf.

Converting \n line endings to \r\n might work for you when you paste
into a Windows app.  It does for me.

cygpath -aw foo/bar | putclip -d

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

  reply	other threads:[~2014-10-02 13:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 21:52 Paul.Domaskis
2014-10-01 22:08 ` Gary Johnson
2014-10-01 22:50 ` Jim Garrison
2014-10-01 22:54   ` Keith Christian
2014-10-01 22:56     ` Keith Christian
2014-10-01 23:06   ` Gary Johnson
2014-10-01 23:11 ` Paul.Domaskis
2014-10-01 23:35   ` Andrey Repin
2014-10-02  2:25     ` Eliot Moss
2014-10-02  2:33       ` Eric Blake
2014-10-02 13:13         ` Buchbinder, Barry (NIH/NIAID) [E] [this message]
2014-10-02 18:20           ` Paul.Domaskis
2014-10-02 23:24             ` Keith Christian
2014-10-03  5:05             ` Andrey Repin
2014-10-03 13:25               ` Paul.Domaskis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6CF2FC1279D0844C9357664DC5A08BA20EC1B6C8@MLBXV06.nih.gov \
    --to=bbuchbinder@niaid.nih.gov \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).