我按照教程写了一个脚本文件,然后运行不了,我是新手,请懂得的朋友帮一下忙!
脚本如下:
!/bin/awk -f
#all comment lines must start with a hash '#'
#name: student_tot.awk
#to call: student_tot.awk grade.txt
#prints total and average of club student points
#print a header first
BEGIN{
print "Student Date Member No. Grade Age Points Max"
print "Name Joined Gained point Available"
print "================================================================================"
}
#let's add the scores of points gained
(tot+=$6)
#finished processing now let's print the total and average point
END
{
print "Club student total points :"tot
print "Average Club Student points:" tot/NR
}
我在终端运行student_tot.awk grade.txt 但是提示错误!,是不是那个awk不是在/bin里面,希望有详细一点的答案,谢谢!
[问题]awk脚本问题
-
- 帖子: 4
- 注册时间: 2008-07-18 15:29
- bones7456
- 帖子: 8495
- 注册时间: 2006-04-12 20:05
- 来自: 杭州
- 联系:
-
- 帖子: 241
- 注册时间: 2008-05-25 20:35
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系: