0

I have a simple command

awk -F "," '{print $3}' FILE_XY

called in the bash script

I need to pass the "$3" as a parameter to this command. Can you please help with the syntax? I tried to add all kinds of brackets, but no luck.

Something like this:

export FIELD="3"
awk -F "," '{print $($FIELD)}' FILE_XY

Many thanks for any hint!

Cyrus
  • 77,979
  • 13
  • 71
  • 125

0 Answers0