From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90104 invoked by alias); 1 Oct 2015 13:13:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 90091 invoked by uid 89); 1 Oct 2015 13:13:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f51.google.com Received: from mail-qg0-f51.google.com (HELO mail-qg0-f51.google.com) (209.85.192.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 01 Oct 2015 13:13:54 +0000 Received: by qgev79 with SMTP id v79so64340390qge.0 for ; Thu, 01 Oct 2015 06:13:52 -0700 (PDT) X-Received: by 10.140.148.203 with SMTP id 194mr12610169qhu.102.1443705232247; Thu, 01 Oct 2015 06:13:52 -0700 (PDT) Received: from [192.168.0.7] (d27-96-48-76.nap.wideopenwest.com. [96.27.76.48]) by smtp.gmail.com with ESMTPSA id g197sm2363164qhc.35.2015.10.01.06.13.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2015 06:13:51 -0700 (PDT) Subject: Re: Why does robocopy confuse input and output files defined with Cygwin/bash and perl? To: cygwin@cygwin.com References: <20150930075400.d50bba72719f91cdb61cd892ddf83b25.788987e5cc.wbe@email11.secureserver.net> <560BFA8D.2050701@cs.umass.edu> <7910682845.20150930222746@yandex.ru> From: cyg Simple X-Enigmail-Draft-Status: N1110 Message-ID: <560D31A0.4030404@gmail.com> Date: Thu, 01 Oct 2015 13:13:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <7910682845.20150930222746@yandex.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00003.txt.bz2 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