Hi,
hopefully this is a quick and easy problem; I want to pass a variable into an awk script so I can select the Nth field in a one record file. Basically I need somebody to fix the syntax of the following example, or tell me I'm barking up the wrong tree...
#!/bin/ksh
n=10
cat /tmp/test.file | awk '{print $n}'
Cheers,
MarkT.
hopefully this is a quick and easy problem; I want to pass a variable into an awk script so I can select the Nth field in a one record file. Basically I need somebody to fix the syntax of the following example, or tell me I'm barking up the wrong tree...
#!/bin/ksh
n=10
cat /tmp/test.file | awk '{print $n}'
Cheers,
MarkT.