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
精彩评论