On 24 Apr 2009, at 10:42, Martin Costabel wrote:

> Charles Lepple wrote:
> []
>> 'grep -c' should be able to cope with empty input (returning 0), as
>> long as you are passing a regex (in this case, 'org.finkproject.dbus-
>> session'). Are you sure it isn't something else?
>
> Well, I tried this: On 10.4.11, I run
>
>    launchctl list | grep -c foo
>
> It returns "0" eventually, but it can take a long time to do so,
> sometimes up to a minute.
>
> This is not deterministic; sometimes it returns immediately. A simple
> "launchctl list" returns immediately every time, as does the command I
> proposed,
>
>    (echo ""; launchctl list) | grep -c foo
>
> Weird.
>

Really weird ...
Trying to confirm this, I get, on 10.4.11,

> # while true; do time { launchctl list | grep -c foo ; } ; done  
> 2>&1 | fgrep real
> real    0m4.101s
> real    0m0.058s
> real    0m0.030s
> real    0m0.024s
> real    0m0.037s
> ...
all the rest of the same order; only the first is long.
And launchctl list | wc -l  gives only 15

On 10.5, all results are between .5 and 1 second; with no difference  
between
the first and subsequent ones.
There launchctl list | wc -l  gives 142 ...

(All this is with fink's grep, but I don't think grep is at issue  
here ..)

JF

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to