Subject: Re: Tests in Cygwin

From: Don Slutz <[email-masked]>
Date: Fri, 08 May 2009 10:19:42 -0400

Here is some testing that does not require a sub-shell and does support 
options:

rhf2-1:~/tmp>foof() { local IFS='       ,+';local args="$*"; for i in 
$args; do echo i=$i; done; }
rhf2-1:~/tmp>foo1() { for i; do echo i=$i; done; }
rhf2-1:~/tmp>foo2() { for i in $*; do echo i=$i; done; }
rhf2-1:~/tmp>foo1 'a b c' d e+f g,h 'j  k'
i=a b c
i=d
i=e+f
i=g,h
i=j k
rhf2-1:~/tmp>foo2 'a b c' d e+f g,h 'j  k'
i=a
i=b
i=c
i=d
i=e+f
i=g,h
i=j
i=k
rhf2-1:~/tmp>foof 'a b c' d e+f g,h 'j  k'
i=a
i=b
i=c
i=d
i=e
i=f
i=g
i=h
i=j
i=k
rhf2-1:~/tmp>uname -a
CYGWIN_NT-5.1 rhf2-1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin

Note: that should be IFS=$' \t+,' and $'j\tk' in case the mailer messes 
this up.   I did not use this bash special syntax.

So which should we go with? foo2() which does the original way or foof() 
which allows you to use ',' and '+', and spaces?
    -Don

-------- Original Message --------
Subject: Re: Tests in Cygwin
From: Alex Riesen <[email-masked]>
To: Junio C Hamano <[email-masked]>
Date: 5/8/2009 5:28 AM
> 2009/5/8 Junio C Hamano <[email-masked]>:
>   
>> Johannes Sixt <[email-masked]> writes:
>>
>>     
>>>>   +for prerequisite in $(echo "$1" | tr , ' ')
>>>>         
>>> So, you dislike the space separator, but you also dislike the IFS games
>>> that save a few new processes? ;) (Think of Windows, where fork is expensive).
>>>       
>> You can play IFS=, game, then ;-)
>>
>> I have to admit that it feels so 80'ish, back when our UNIX machines were
>> so slow that we tried to shave every fork+exec from our shell scripts by
>> using built-ins when possible, though.
>>     
>
> Well, on Windows (at least with Cygwin), it is 80's still. My workstation
> (a 2.4GHz P4, 70C hot, 2Gb Dell monster) is about 100x slower than my
> old Asus laptop (a 384Mb, 1200Ghz Pentium-M) in starting a trivial program
> ("int main() { return 0; }").
>
> I'm trying to save where possible on cygwin, whatever cost.
>   

__________________________________________________________________________________________________________________
DISCLAIMER:"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation." 
________________________________________________________________________________________________________________