I have a simple awk
program:
#!/usr/bin/awk -f
BEGIN {print "work already!"}
If I run it as:
awk -f panic
on the (osx) terminal it works. But it fails if I try running it as a script:
. panic
-bash: BEGIN: command not found
I checked the location of awk using which awk
and it is indeed located at /usr/bin/awk
. Any ideas why it isn't working?
Run it as ./panic
, not . panic
, as the latter is the same as running source panic
, which won't do what you want. See man source
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