Can I create an awk variable in a one liner using bash command substitution techniques? Here is what I am trying, but something is not right.
awk -v AVG=$(uptime|awk '{print $(NF-2)}') '{ if ( AVG >= 1 ) print "there is a load" }'
Perhaps it's because the command substitution uses Awk (though I doubt it)? Maybe that's too "Inception-ish"? GNU Awk 3.1.7
There is nothing wrong with your command. Your command is waiting for an input and that's the only reason why it doesn't get executed!
For instance:
Just include BEGIN in your command as suggested by the experts!