public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: cyg Simple <cygsimple@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Why does robocopy confuse input and output files defined with Cygwin/bash and perl?
Date: Thu, 01 Oct 2015 13:13:00 -0000	[thread overview]
Message-ID: <560D31A0.4030404@gmail.com> (raw)
In-Reply-To: <7910682845.20150930222746@yandex.ru>

On 9/30/2015 3:27 PM, Andrey Repin wrote:
> Greetings, Eliot Moss!
> 
>> Dealing with "odd" characters like \ and such can be a pain, huh?
>> Perhaps it will help you to know that bash will expand variables
>> inside double-quoted arguments, i.e., "${src}".  (You can write
>> "$src" if you want, but over the years I am finding it clearer /
>> better to use the { } to make clear the name of the variable I
>> want expanded.)
> 
>> Also, you may find the cygpath utility helpful, and the $( ) idiom
>> of bash.
> 
> It isn't "idiom of bash", it is a POSIX construction.
> 
>> Thus:
> 
>> robocopy /s "$(cygpath -w /cygdrive/c/Users/siegfriend/Documents/bin)" "$(cygpath -w
>> /cygdrive/f/backup/unison/bin)"
> 
>> I believe this will do what you want.  cygpath can be very helpful
>> hen you desire to run a Windows program from the cygwin environment.
> 
> I would suggest cygpath -m.

Not for robocopy, it is likely not to survive / instead of \.  I would
prefix it with "cmd /c" though or perhaps create a bash script called
robocopy to do the path conversion before calling the Windows
robocopy.exe.  That way the command line looks typical.

-- 
cyg 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:[~2015-10-01 13:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 14:54 siegfried
2015-09-30 15:07 ` Eliot Moss
2015-09-30 19:35   ` Andrey Repin
2015-10-01 13:13     ` cyg Simple [this message]

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=560D31A0.4030404@gmail.com \
    --to=cygsimple@gmail.com \
    --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).