Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
03-26-2015, 03:34 AM
#1
Member
Registered: Jan 2015
Posts: 56
Rep:
Error in awk file execution
Sir when i execute this gawk command it gives me same error for any files.Why this happen?
Code:
[root@localhost ns-allinone-2.34]# gawk –f throughput1.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]#
03-26-2015, 04:29 AM
#2
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,899
how did you edit that awk file?
03-26-2015, 04:49 AM
#3
Member
Registered: Jan 2015
Posts: 56
Original Poster
Rep:
I have used this thruput.awk file and out1.tr is sample file created by la.tcl file .I copy and past trrougput.awk in same folder with la.tcl (give out1.tr file). And the execute the command gawk f throughput1.awk out1.tr. It is wrong method to take awk result of this two files?
Code:
#####################################################################
################http://www.ns2blogger.blogspot.in/###################
#####################################################################
BEGIN {
recvdSize = 0
startTime = 1e6
stopTime = 0
}
{
# Trace line format: new
if ($2 == "-t") {
event = $1
time = $3
node_id = $5
flow_id = $39
pkt_id = $41
pkt_size = $37
flow_t = $45
level = $19
}
# Store start time
if (level == "AGT" && (event == "+" || event == "s") && pkt_size >= 512) {
if (time < startTime) {
startTime = time
}
}
# Update total received packets' size and store packets arrival time
if (level == "AGT" && event == "r" && pkt_size >= 512) {
if (time > stopTime) {
stopTime = time
}
# Rip off the header
hdr_size = pkt_size 512
pkt_size -= hdr_size
# Store received packet's size
recvdSize += pkt_size
}
}
END {
printf("Average Throughput[kbps] = %.2f\t\t StartTime=%.2f\tStopTime=%.2f\n",(recvdSize/(stopTime-startTime))*(8/1000),startTime,stopTime)
}
03-26-2015, 04:56 AM
#4
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,899
Sorry, it looks like the file was somehow damaged during download or copy/paste or ???. Did you try to modify it by yourself?
03-26-2015, 04:56 AM
#5
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
"gawk -f"
The hyphen that you are using is wrong . Must be ' - '.
-
Last edited by knudfl; 03-26-2015 at 04:58 AM .
1 members found this post helpful.
03-26-2015, 05:05 AM
#6
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Besides that, no need to copy / paste a file.
"All" the throughput scripts are included in 'awk-and-perl_scripts_12.2014.tar.gz'
https://drive.google.com/file/d/0B7S...ew?usp=sharing
avg_throughput.awk
avg_throughput-zigbee.awk
avg_thr_wirelss.awk
chainThroughput.pl
e2ethroughput.awk
flow-thr.awk
genthroughput.awk
instantThroughput.awk
instantThroughputStll.awk
Lianghui-throughput.pl
myflowcalcall_throu.awk
thr_drop_delay.awk
thr-one.pl
Throughput2007.awk
throughput-8.pl
throughput-9.pl
throughput_newtrace.awk
throughput.pl
thruput.awk
updown-link-thr.pl
wireless-thr.awk
03-26-2015, 05:08 AM
#7
Member
Registered: Jan 2015
Posts: 56
Original Poster
Rep:
post#4 If i am using any other file it gives me same error.
post#5 you mean to say that i have to use "- f" instead "-f" ?
03-26-2015, 05:12 AM
#8
Member
Registered: Jan 2015
Posts: 56
Original Poster
Rep:
#post 6 i found folder "awk-and-perl_scripts_11.19.2014" For what pourpose i have to use it?
Sir i simply want to calulate my xyz.tcl file`s throughput. For that i found that i have to use this command "gawk f throughput1.awk out1.tr" .
03-26-2015, 06:29 AM
#9
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Quote:
"awk-and-perl_scripts_11.19.2014" For what pourpose
* Try out the ~20 "throughput scripts" to know if any of those will work with your unknown file.
Usually you cannot just choose a random script from the Internet.
May not work with your trace file.
Hence the choice of ~20 scripts : You may have luck with one or two scripts.
( Besides that, not all trace files may be fit for analyzing.)
-
03-26-2015, 10:03 AM
#10
Member
Registered: Jan 2015
Posts: 56
Original Poster
Rep:
sir i have tried all awk files but it gives me the same result
Code:
[root@localhost ns-allinone-2.34]# gawk –f all.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f all.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f all.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f all.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del.awk wireless..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del.awk out1..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk out1..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Del_Flow.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit.awk wireless..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit_Flow.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit_Flow.awk wireless..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit_Flow.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit_Flow.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Jit_Flow.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avgStats.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avgStats.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avgStats.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avgStats.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk wireless..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk out1..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk out1..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk wireless..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk kmeans..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_throughput.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f Avg_Tput_Flow.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f avg_thr_wirelss.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f wireless-thr.awk wireless.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f wireless-thr.awk kmeans..tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f wireless-thr.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f wireless-thr.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f wireless-thr.awk o.tr
otcl/ otcl_ns234_gcc-4.4.patch out1.tr
otcl-1.13/ out1.nam
[root@localhost ns-allinone-2.34]# gawk –f wireless-thr.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f updown-link-thr.awk out1.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f updown-link-thr.awk my.tr
gawk: –f
gawk: ^ invalid char '�' in expression
[root@localhost ns-allinone-2.34]# gawk –f updown-link-thr.awk kmeans.tr
gawk: –f
gawk: ^ invalid char '�' in expression
How can i get result using awk file? How can i get energy,throughput etc. value of my .tcl file
03-26-2015, 10:09 AM
#11
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
You will get ""gawk: ^ invalid char '' in expression""
... until you stop with using forbidden characters in your command.
The hyphen ( - ) that looks like two hyphens (--) is not a valid character.
03-26-2015, 10:52 AM
#12
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780
It shows up here as a 3-em dash, not a minus sign. It's not apparent how you are getting that into a command line, perhaps by cutting and pasting the output from some word processor.
03-26-2015, 11:03 AM
#13
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313
seems like ms-windows copy-pasta:
edit: i am not even sure how you are pasting a
dash (instead of a
hyphen ) into the post. it wont allow me to in this example.
Last edited by schneidz; 03-26-2015 at 11:08 AM .
1 members found this post helpful.
03-26-2015, 12:10 PM
#14
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
@schneidz : Yes, that's odd.
Some members can type or copy/paste any forbidden character.
My attempts typing or copy/paste from e.g. post #1 are not shown too.
03-26-2015, 01:09 PM
#15
Member
Registered: Jan 2015
Posts: 56
Original Poster
Rep:
sir.i got results. If it is valid or not?
Code:
[root@localhost ns-allinone-2.34]# gawk -f throughput_newtrace.awk out1.tr
Average Throughput[kbps] = -0.00 StartTime=400.00 StopTime=0.00
[root@localhost ns-allinone-2.34]# gawk -f Throughput2007.awk out1.tr
Average Throughput[kbps] = -0.00 StartTime=1000000.00 StopTime=0.00
Average Throughput[kbps] = -0.00 StartTime=1000000.00 StopTime=0.00
[root@localhost ns-allinone-2.34]# gawk -f genthroughput.awk out1.tr
Average Throughput[kbps] = -0.00 StartTime=400.00 StopTime=0.00
Is there any link from where i get parameaters awk file, network life time, energy, througput,scalabiltty,efficiency,Energy Consumption, power consumption and overall network performance,Power Usage of my .tcl file?
All times are GMT -5. The time now is 08:44 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News