LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-17-2014, 03:27 AM   #1
Faiza Al-Salti
Member
 
Registered: May 2014
Posts: 38

Rep: Reputation: Disabled
an awk script to calculate energy consumption


Hi,

Can anyone help me in writing an awk script to calculate total energy consumption from a trace file with new-trace format produced by NS2?
 
Old 07-17-2014, 12:20 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,890
Blog Entries: 13

Rep: Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934
Not many will help in the form of just writing a script to suit your needs. For starters you ought to determine how to calculate what you wish from the available data, in parallel determining if you have sufficient data to accomplish this. The next step would be to attempt a script, either with awk, bash, python, or some other script language. I just said in another thread that I'm not highly experienced with awk, but ... I don't believe it is a script language. Bash is, as is python, tcl, and perl. Awk is a pattern scan and processor; which will do actions; however you'd use something like a bash script to invoke awk in the way you wish. For instance, say you have record files and need to extract specific parts of records to use as the numbers for your calculations, then you'd use awk to help you there; and as said earlier, you'd use a scripting language to perform the rest of the operations.

Here are some references on bash:

Bash Guide for Beginners

Advanced Bash Scripting Guide

Blog Entry on Bash Scripting
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimizing nodes energy consumption for Mobile Ad Hoc Networks (MANET) Using Fuzzy lo must Linux - Wireless Networking 0 03-06-2014 06:45 PM
Energy.awk required to compute remaing energy of nodes. Aska123 Linux - Wireless Networking 2 02-02-2014 02:31 AM
[SOLVED] Calculate time with awk with an exception for the last line jostber Programming 9 04-17-2013 08:17 AM
controlling energy consumption ns2 MounaRM Linux - Networking 2 04-21-2011 04:45 AM
Reducing Computer Energy Consumption Woodsman Slackware 1 10-04-2008 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration