public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Direct/efficient way to chop off trailing \n
@ 2014-10-01 21:52 Paul.Domaskis
  2014-10-01 22:08 ` Gary Johnson
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Paul.Domaskis @ 2014-10-01 21:52 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-10-03 13:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 21:52 Direct/efficient way to chop off trailing \n 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]
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

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).