1 |
* Thanh Ly [lycander@×××××××.com] [2003-09-04 01:24 -0400]: |
2 |
|
3 |
> Thanks cal, the script works great. I modified it slightly so that it |
4 |
> would output into a text file: |
5 |
> |
6 |
> cat find ... <rest of script> |
7 |
> done > ~/output.txt |
8 |
|
9 |
humm .. no need for cat .. by default output will go to STDOUT but you |
10 |
rediect to a file like so: |
11 |
|
12 |
for i in `find /usr/portage/${my_target_subdir} -name "*.ebuild" -print` ; |
13 |
do egrep -l "^KEYWORDS=\".*~ppc.*\"" $i >| output.txt ; |
14 |
done |
15 |
|
16 |
anyhow .. the previously send code was quite wrong (the regular |
17 |
expression specificly). I was checking for 'one' when in fact in needs |
18 |
'zero or more' (on the egrep expression). I didn't notice when first |
19 |
testing as i was consistantly checking for ppc or ~ppc (which rarely |
20 |
come after the " .. x86 generally occupies that space in the line. |
21 |
|
22 |
I've made a proper script (see attatched version 0.1). It should now |
23 |
work for any arch or ~arch. I've tested it somewhat and it seems ok |
24 |
(though there could still be bugs). |
25 |
|
26 |
So .. for a dated log of ebuilds KEYWORDED ~ppc: |
27 |
|
28 |
keyworded.sh ~ppc /usr/portage >| output-`date +%F`.txt |
29 |
|
30 |
best |
31 |
|
32 |
cal |