LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to understand awk (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-understand-awk-4175502190/)

chenil 04-18-2014 11:00 AM

how to understand awk
 
1 Attachment(s)
I want to understand attached energy_wireless.awk.

Please guide me.

grail 04-18-2014 11:55 AM

Exactly what guidance are you looking for?

Are you saying you have looked through the manual and none of what is contained in the script makes sense?

knudfl 04-18-2014 02:55 PM

"energy_wireless.awk" is an "awk script for ns2 trace files".

Using, example : $ ns wireless-flooding.tcl
.. will create the trace file "wireless-flooding-DumbAgent.tr"
Code:

$ awk -f energy_wireless.awk wireless-flooding-DumbAgent.tr                                       
No of pkts send                43
No of pkts recv                65
Pkt_delivery_ratio:            151.163
Control_overhead:              0
Normalized_routing_overheads:  0
Delay:                          0.00385983
Throughput:                    224612
Jitter:                        0.0082657
No of Pkts Dropped              -22
Dropping_Ratio:                -51.1628
Total_Energy_Consumption:      0
Avg_Energy_Consumption:        0
Overall Residual Energy:        -23
Avg Residual Energy:            -1


chenil 04-19-2014 12:25 PM

understanding awk
 
Quote:

Originally Posted by grail (Post 5155147)
Exactly what guidance are you looking for?

Are you saying you have looked through the manual and none of what is contained in the script makes sense?

Yes i am unable to understand the content..how to write awk?

can you send me any ".awk" script along with a ".tr" and explanation about how to write it?
I am fully confused..

knudfl 04-19-2014 01:20 PM

# 4 . How to write awk ...
 
https://www.google.com/webhp?hl=all#...w+to+write+awk

chenil 04-19-2014 01:22 PM

need of .sh file
 
Quote:

Originally Posted by knudfl (Post 5155625)

What is need of ".sh" file in implementation?

knudfl 04-19-2014 02:17 PM

# 6 .
Quote:

What is need of ".sh" file ...
Do you mean a shell script / bash script ? And which one ?

grail 04-20-2014 08:43 AM

Well I see nothing from the original script that is very hard to understand assuming you have read the manual.

In case you had trouble using google or any other search engine to find one:

http://www.gnu.org/software/gawk/man...ode/index.html

After reading the manual, please advise which part you are confused about?
Quote:

can you send me any ".awk" script along with a ".tr" and explanation about how to write it?
Not sure what a ".tr" is, but as you are asking the question it would be up to you to provide what it is you do not understand and to actually ask a clear question.


All times are GMT -5. The time now is 01:48 AM.