Hello I have the following awk script:
BEGIN {
{FS = " " }
{print "\t\tIllegal Loggon Attempts on MAIL\n"}
{"date" | getline d}
{printf "\t %s\n",d }
{print "Loggon Name\t\t\t Number of Attempts\n"}
{print"================================================\n"}
}
{printf "%-28s\t%s\n", $2, $1 }
I call it from a shell script using the following command:
awk -f processing.awk names2.tmp > email.tmp
awk reports no error but it seems that the entire BEGIN clause is not processed only the {printf "%-28s\t%s\n", $2, $1 }. And I do need the header to print. I tried commenting out {printf "%-28s\t%s\n", $2, $1 } and then the header prints! It seems that somehow the final directive is overwriting the BEGIN clause. Can someone tell me how to fix this problem?