Re: Tests in Cygwin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <raa.lkml@xxxxxxxxx>
To: Junio C Hamano <gitster@xxxxxxxxx>
Date: 5/8/2009 5:28 AM
2009/5/8 Junio C Hamano <gitster@xxxxxxxxx>:
Johannes Sixt <j.sixt@xxxxxxxxxxxxx> 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." ________________________________________________________________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]