由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - how to count the times a function is called
相关主题
help! cannot bind to socket!想写个小东东
[转载] I cannot install cxterm?!Which library include gethostbyname?
Unix semaphoreunix系统下能不能装什么聊天软件?
compile c[转载] SIGTSTP
帮帮忙,用C作一个SHELLft, 本版备忘录
What's the function to get the local ipOne shell question
Re: What's the function to get the local ip初级awk问题
help need for a make question (simple one)有没有朋友懂yacc,真诚请教
相关话题的讨论汇总
话题: function话题: count话题: called话题: times话题: file
进入Unix版参与讨论
1 (共1页)
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.

1 (共1页)
进入Unix版参与讨论
相关主题
有没有朋友懂yacc,真诚请教帮帮忙,用C作一个SHELL
普通用户的login attempt failed le...What's the function to get the local ip
[转载] 一个问题Re: What's the function to get the local ip
[转载] 大家来讨论讨论help need for a make question (simple one)
help! cannot bind to socket!想写个小东东
[转载] I cannot install cxterm?!Which library include gethostbyname?
Unix semaphoreunix系统下能不能装什么聊天软件?
compile c[转载] SIGTSTP
相关话题的讨论汇总
话题: function话题: count话题: called话题: times话题: file