Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Mon, 10 Mar 2003 10:19:32 -0500 (EST) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: hauser AT acm DOT org cc: cygwin AT cygwin DOT com Subject: RE: cygpath "$@" in a script: bug? In-Reply-To: Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Ralf, Please keep replies on-list... And please honor the "Reply-To:"... On Mon, 10 Mar 2003, Ralf Hauser wrote: > Thanks for the help, someone else suggested out of the mailing list to do it > with > > for file in "$@"; do > memfile="${memfile:-""}$file\n" > done > mycommand $(echo -e "$memfile" | cygpath -w -f -) Yes, this will work too... > but even then, it chokes if the input parameters are already a windows-style > path with spaces... cygpath has been changed to accept only Unix-style paths with a '-w' option. There was a long discussion of that on the list last month (a search for "cygpath ensure" should find it). > What do you think about the other below abnormalities? "Use the source, Luke" (tm) ;-) Igor > > -----Original Message----- > > From: Igor Pechtchanski [mailto:pechtcha AT cs DOT nyu DOT edu] > > Sent: Montag, 10. Marz 2003 16:05 > > To: hauser AT acm DOT org > > Cc: cygwin AT cygwin DOT com > > Subject: Re: cygpath "$@" in a script: bug? > [...] > > > > Yes, it needs the newlines (LF is enough, I think). > > But if you have the arguments properly quoted already, why not > > 'for f in "$@"; do cygpath -w "$f"; done'? > > > > > Or even worse if I put in the long path: > > > > > > testscript `/bin/ls /cygdrive/c/cygwin/bin/ch*` > > > > Abnormality 1) > > > cygpath: error converting "/cygdrive/c/cygwin/bin/checkgid.exe > > > /cygdrive/c/cygwin/bin/chgrp.exe /cygdrive/c/cygwin/bin/chmod.exe > > > /cygdrive/c/cygwin/bin/chown.exe /cygdrive/c/cygwin/bin/chroot.exe" > > > > > > or yet worse when I do that on my desktop with three test files a.txt, > > > aa.txt and aaa.txt: > > > rhauser AT PC:/<3>rhauser/Desktop> > > > testscript `ls /cygdrive/c/Docume~1/rhauser/Desktop/a*.txt` > > > c:\Docume~1\rhauser\Desktop\a.txt > Abnormality 2 - particularly strange if cygwin no longer recognizes its own > path syntax!!! > > > \cygdrive\c\Docume~1\rhauser\Desktop\aa.txt > > > \cygdrive\c\Docume~1\rhauser\Desktop\aaa.txt > > > > > > so the first path is converted properly while number 2 and 3 are wrong? -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk! -- /usr/games/fortune -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/