I'm trying to create AWK script that will filter the input file according to some pattern, and use the strftime() function for some calculations.
($2 ~ /^[HB]/ && $2 ~ /n$/){
print strftime("%Y")
}
The interpreter in use is mawk. When triggering this script using this command:
awk -f script3 inputFile
I'm getting the error: "function strftime never defined"
Installing GAWK will get you the function strftime back that you are missing natively in awk.
With Ubuntu 11.10 or simiar distribution you would issue following command to get the GAWK
sudo apt-get install gawk
You can also use it in gawk however you don't have to and can simply go ahead with your original awk script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With