h**o 发帖数: 548 | 1 I have a file which records the activities of all functions.
I want to count from this file how many times each of the function is called.
How to write a unix shell to count them?
or
is there any other way?
Thanks |
c****j 发帖数: 258 | 2 don't know your file format, assume:
KEYWORD_TO_KNOW_A_FUNCTION_CALL func_name foo ...
other logs
...
awk '/KEYWORD_TO_KNOW_A_FUNCTION_CALL/ {cnt[$2]} END{for (f in cnt) print
f,
cnt[f]}'
called.
【在 h**o 的大作中提到】 : I have a file which records the activities of all functions. : I want to count from this file how many times each of the function is called. : How to write a unix shell to count them? : or : is there any other way? : Thanks
|
h**o 发帖数: 548 | 3 I have a file which records the activities of all functions.
I want to count from this file how many times each of the function is called.
How to write a unix shell to count them?
or
is there any other way?
Thanks |
c****j 发帖数: 258 | 4 don't know your file format, assume:
KEYWORD_TO_KNOW_A_FUNCTION_CALL func_name foo ...
other logs
...
awk '/KEYWORD_TO_KNOW_A_FUNCTION_CALL/ {cnt[$2]} END{for (f in cnt) print
f,
cnt[f]}'
called.
【在 h**o 的大作中提到】 : I have a file which records the activities of all functions. : I want to count from this file how many times each of the function is called. : How to write a unix shell to count them? : or : is there any other way? : Thanks
|
s******0 发帖数: 13782 | 5 cat yourfile | grep yourFunctionName | wc -l
called.
【在 h**o 的大作中提到】 : I have a file which records the activities of all functions. : I want to count from this file how many times each of the function is called. : How to write a unix shell to count them? : or : is there any other way? : Thanks
|
T**********l 发帖数: 12149 | 6
【在 s******0 的大作中提到】 : cat yourfile | grep yourFunctionName | wc -l : : called.
|