- 论坛徽章:
- 0
|
本帖最后由 linoom 于 2010-05-19 11:06 编辑
开始用awk在linux下都好好的 ,在sunos上调了半天不行,,,(awk 报错信息在3楼)
然后就把awk全部用nawk替换了,,能运行,结果也对,但开始输出了很多错误信息,如下:
nawk: no program given
nawk: no program given
nawk: no program given
nawk: no program given
nawk: no program given
nawk: no program given
而nawk使用的语句如下:
name=`cat /etc/passwd | nawk -F :'{if($1~/'$i'$/) print $5}'`
nawk -F: '{$(NF+1)=$8+$9+$10+$11+$12+$13+$14+$15+$16+$17;print $0}' out1 | \
nawk '{$(NF+1)=$3+$4+$5+$6+$7+$18+$20+$19*0.5;print $1,$2,$3,$4,$5,$6,$7,$20,$18,$19,$21}' | \
nawk 'BEGIN {print "STUD# Name A1 A2 A3 A4 A5 EXE TUT EXAM TOTAL"};{print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11}' | \
nawk '{printf("%-10s%-20s%5s%5s%5s%5s%5s%5s%5s%5s%6s\n",$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)}'
大家帮看看咋回事?????、、、、多谢 |
|