#!/usr/bin/awk -f
{if(!FILENAME) {print "<Gasp.sh> <inputfile>"; exit} calc = 0;....}
I am trying to print out a usage statement in my awk script so if the script is run without an input file, it shows the usage. This is my attempt, but I assume I am not using the FILENAME
variable correctly. I also tried putting the if statement in a BEGIN
and END
block but nothing has worked.
BEGIN{if (ARGC!=2) {print "<Gasp.sh> <inputfile>"; exit} {calc = 0;....}
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