I have a script where I run a pipeline and the last command is awk
, and I'd like to place a command line argument in that part.
OUTPUT=`sort -t' ' -k +6,6 -k +7,7 | awk '{print " $1"$0}'`
I'd like the $1
in the end to be the argument that I received when I ran the script, instead of being treated as a dollar-one string and being parsed by the awk
command.
Is there an elegant solution for that, or should I just pass on the awk
part and then iterate over every line of OUTPUT
and add the spaces and arguments I wanted to add with awk
?