How to parameterize which field awk should print?
I have a script that runs awk and i want to parameterize which field awk prints. For example, go.sh contains:
#!/bin/bash
echo one two three | awk ' {print $2} '
I want to be able to pass set the field that awk prints at run time, eg, this would tell awk to print the 3rd field:
go.sh 3
I can't figure out how to do this.
|