Problem one:
You didn't understand awk's pattern and actions well. google some tutorial and read that part.
like : http://www.chemie.fu-berlin.de/chemnet/use/info/gawk/gawk_9.html
in your awk file, you should either have:
#! /bin/awk -f
BEGIN {} {if(/keyword/) {print}}
or
#! /bin/awk -f
BEGIN {} /keyword/ {print}
in fact, the above line could be shorten into (assume you need the BEGIN
block):
#!/bin/awk -f
BEGIN {} /keyword/
Problem two:
the hashbang line need -f
so :
#!/bin/awk -f
then you could under same dir, do:
./myawk.awk inputfile