1 |
* "Calum Selkirk" <cselkirk@××××××.nl>: |
2 |
> * Thanh Ly [lycander@×××××××.com] [2003-09-04 01:24 -0400]: |
3 |
> > cat find ... <rest of script> |
4 |
> > done > ~/output.txt |
5 |
> |
6 |
> humm .. no need for cat .. by default output will go to STDOUT but you |
7 |
> rediect to a file like so: |
8 |
> |
9 |
> for i in `find /usr/portage/${my_target_subdir} -name "*.ebuild" -print` ; |
10 |
> do egrep -l "^KEYWORDS=\".*~ppc.*\"" $i >| output.txt ; |
11 |
> done |
12 |
|
13 |
Ah, but you could also increase speed vastly by not using a loop: |
14 |
(with both of them reading from memory) |
15 |
|
16 |
$ time for i in `find /usr/portage/ -name "*.ebuild" -print`; do egrep -l "^KEYWORDS=\".*~ppc.*\"" $i; done |
17 |
|
18 |
real 1m8.892s |
19 |
user 0m31.380s |
20 |
sys 0m41.600s |
21 |
|
22 |
$ time find /usr/portage/ -name "*.ebuild" |xargs egrep -l "^KEYWORDS=\".*~ppc.*\"" |
23 |
|
24 |
real 0m1.053s |
25 |
user 0m0.810s |
26 |
sys 0m0.900s |
27 |
|
28 |
|
29 |
;) Cheers, |
30 |
n. |
31 |
|
32 |
-- |
33 |
Buffy: Vampires are creeps. |
34 |
Giles: Yes. That's why one slays them. |
35 |
|
36 |
-- |
37 |
gentoo-ppc-dev@g.o mailing list |