"cygpath -u" inside backticks differs
It may be something very simple, but I just cannot figure what it is, nor can I find anything on the forums. Here - see the different results: / > echo `cygpath.exe -u '\\DAEMON1\anrdaemon\.profile'` /c/DAEMON1/anrdaemon/.profile / > cygpath.exe -u '\\DAEMON1\anrdaemon\.profile' //DAEMON1/anrdaemon/.profile So cygpath in backticks slaps a drive at the front, while otherwise it does ... well, what I expect. Does anyone know why? Or know a thread where this is explained? Many thanks! Ivan PS: I am running a fairly recent version of cygwin 1.7.27 ... and I just checked it in 1.7.29 -- 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
Re: "cygpath -u" inside backticks differs
On 06/03/2014 07:28 PM, Ivan Dobrianov wrote: > It may be something very simple, but I just cannot figure what it is, nor can > I > find anything on the forums. echo 'a\b\\c\\\de' echo `echo 'a\b\\c\\\de'` echo $(echo 'a\b\\c\\\de') see why `` is obsolete, and you should be using $()? Among other reasons, \ inside `` has weird rules. > PS: I am running a fairly recent version of cygwin 1.7.27 ... and I just > checked > it in 1.7.29 Your problem has nothing to do with cygpath, and everything to do with shell quoting rules. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
Re: "cygpath -u" inside backticks differs
Eric - thanks for the info! I see the problem, yes, and it is simple - I have completely "slepth through" the $() business :-) I am all set now - thanks! Ivan -- 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
Re: "cygpath -u" inside backticks differs
Eric Blake writes: > > see why `` is obsolete, and you should be using $()? Among other > reasons, \ inside `` has weird rules. > Wow, when did this happen? I've been using `` for years, and never heard of $(). What version did this change? I think I need to go back and re-read some documentation! Dave -- 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
Re: "cygpath -u" inside backticks differs
On 06/04/2014 08:31 AM, J. David Boyd wrote: > Eric Blake writes: > >> >> see why `` is obsolete, and you should be using $()? Among other >> reasons, \ inside `` has weird rules. >> > > Wow, when did this happen? I've been using `` for years, and never heard of > $(). What version did this change? $() has existed in all sh variant shells except Solaris /bin/sh pretty much since the 80s; it was standardized in POSIX in the 90s. (On Solaris, you have to use /usr/xpg4/bin/sh instead of /bin/sh to get it) -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
Re: "cygpath -u" inside backticks differs
On Wed, Jun 4, 2014 at 5:48 PM, Eric Blake wrote: > On 06/04/2014 08:31 AM, J. David Boyd wrote: >> Wow, when did this happen? I've been using `` for years, and never heard of >> $(). What version did this change? > > $() has existed in all sh variant shells except Solaris /bin/sh pretty > much since the 80s; it was standardized in POSIX in the 90s. (On > Solaris, you have to use /usr/xpg4/bin/sh instead of /bin/sh to get it) I never understood the need for these fancy new features :) Csaba -- GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++ The Tao of math: The numbers you can count are not the real numbers. Life is complex, with real and imaginary parts. "Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds "People disagree with me. I just ignore them." -- Linus Torvalds -- 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