最重要的是。请我检查了其他看起来相似或具有相同错误代码的错误。他们似乎不一样。我需要你的帮助。万分感谢
# Create awk program : myflowcalcall.awk
# a general script for computing throughput
BEGIN {
arguments = 2;
if (ARGC < arguments || ARGC > arguments || flowtype == 0) {
printf("error: wrong number of arguments.\nawk: usage – awk -f flowcalc.awk [-v graphgran=value] [-v fidfrom=value] [-v fidto=value] [-v fid=value] -v flowtype=\"type\" -v outdata_file=\"filename\" indata_file\n–%d",ARGC);
exit;
}
measure_interval = 0.5;
bits = 0;
first_time = graphgran;
}
{
if (($1 == "r") &&
((fidfrom == 0 && fidto ==0) || (($8 == fid) && ($3 == fidfrom) && ($4 == fidto))) &&
(flowtype == "all" || flowtype == $5)) {
if (($2 - first_time) > measure_interval) {
first_time = first_time + measure_interval;
rate = (bits/1000000)/first_time;
print filename first_time, rate;
}
bits = bits + $6 * 8;
}
}
END {
measure_interval = 0.5;
first_time = first_time + measure_interval;
rate = (bits/1000000)/first_time;
print filename first_time, rate;
}
有一个错误是
awk: myflowcalcall.awk:20: if (($2 – first_time) > measure_interval) { awk: myflowcalcall.awk:20: ^ invalid char '�' in expression
我已经尝试并检查了错误,但无济于事。下面是我在 Ubuntu 12.04LTS 中从终端运行的命令
awk -f myflowcalcall.awk -v graphgran=0 -v fidfrom=2 -v fidto=3 -v fid=1 -v flowtype=”cbr” -v outdata_file=”nothing” johna4bp.tr > thr1
运行
xxd myflowcalcall.awk | grep " e2\|e2 "
生产
00000f0: 6177 6b3a 2075 7361 6765 20e2 8093 2061 awk: usage ... a
0000190: 6174 615f 6669 6c65 5c6e e280 9325 6422 ata_file\n...%d"
00002c0: 2828 2432 20e2 8093 2066 6972 7374 5f74 (($2 ... first_t
我可以知道错误点吗?谢谢大家