I've written a very simple gawk program which runs when I execute it at the POSIX shell but the corresponding '.awk' script I wrote doesn't return
any data. I'm on an HP-UX running gawk version 3.1. (w/all the defaults)
(As you can probably guess I'm a newbie going through the manual and trying to execute the code samples).
I did write another script ( advice.awk
) and it works fine.
$cat find_li.awk
# searches file: mail-list looking for regexp "li" and reporting 2nd column
# (which is the phone number) if found
#! /usr/local/bin/gawk '/li/ { print $0 }' mail-list
$find_li.awk (this is the run of my script w/no results)
$
(Below is me running the commands in the script and it works fine)
$/usr/local/bin/gawk '/li/ { print $0 }' mail-list
Amelia 555-5553 amelia.zodiacusque@gmail.com F
Broderick 555-0542 broderick.aliquotiens@yahoo.com R
Julie 555-6699 julie.perscrutabor@skeeve.com F
Samuel 555-3430 samuel.lanceolis@shu.edu A
So - Why doesn't the script return any results?
(I did do the chmod +x find_li.awk
)