Fozzeebear
Technical User
I have a multi-line awk program that I usually run from the command line using: nawk -f program < input > output.
I know that it is possible to run small awk programs directly from the command line, like: nawk '{print $1}' < input.
However, when I try to use this format for running the multi-line program from the command line (eventually, I want it in a shell script) it fails.
Is this possible? If so, what is the correct syntax for running a mult-line awk program from the command line or within a shell script without having to reference another file that contains the program.
Any help much will be much appreciated!
I know that it is possible to run small awk programs directly from the command line, like: nawk '{print $1}' < input.
However, when I try to use this format for running the multi-line program from the command line (eventually, I want it in a shell script) it fails.
Is this possible? If so, what is the correct syntax for running a mult-line awk program from the command line or within a shell script without having to reference another file that contains the program.
Any help much will be much appreciated!