public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Keith Christian <keith1christian@gmail.com>
To: jhg@acm.org, cygwin@cygwin.com
Subject: Re: Direct/efficient way to chop off trailing \n
Date: Wed, 01 Oct 2014 22:54:00 -0000	[thread overview]
Message-ID: <CAFWoy7EuG5vr2=QvEL5Js5Zg8rNfmLbHUYOrmnEdZsJ2vGFSnQ@mail.gmail.com> (raw)
In-Reply-To: <542C854D.3050001@jhmg.net>

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

  reply	other threads:[~2014-10-01 22:54 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 [this message]
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

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='CAFWoy7EuG5vr2=QvEL5Js5Zg8rNfmLbHUYOrmnEdZsJ2vGFSnQ@mail.gmail.com' \
    --to=keith1christian@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=jhg@acm.org \
    /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).