I have an awk script contained within a ksh script that I want to read the contents of a file with, say 3 records. Fields are a, b, and c, delimiter '|'.
I want to read the file and then I want to set different variables for $1, $2, $3 to be used as parameters to run a series of reports outside the scope of the awk script but within the same ksh script.
How do I do this? I am lost right now. Here's partially what I have..
# Run each of the reports in series (3 total) for each record:
awk '
BEGIN{FS="|";FILENAME="$loc/myfile"}
split(FILENAME,results,FS)
a=results[1]
b=results[2]
c=results[3]
etc.
Thanks very much. I have looked in Oreilley, FAQ, and on awk tutorial site but doesn't show me how to do s/t like this -- How to execute the rest of a command like sacego within/outside of? awk using parameters retrieved in the awk program.
Please advise.
Giannicello