开发者

problem with awk script

when I call my awk script, I keep getting an error :

sam@sam-laptop:~/shell/td4$ awk -f agenda.awk -- -n Robert a开发者_运维问答genda.txt
awk: agenda.awk:6: printf "Hello"
awk: agenda.awk:6: ^ syntax error

the script contains this :

#!/usr/bin/awk
BEGIN {
}

printf "Hello"

END {
}

Thank you


you need to wrap it in {}


BEGIN {
}
{
 printf "Hello"
}
END {
}


i think you also need to modify the shebang as

#!/usr/bin/awk -f
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜