I just want to substract the 2nd column from the first, I didawk { print $1-$2; }I get a syntax error. For information, input is piped in from another process.
What is wrong with this very simple awk command?
awk
Since youre using double quotes, the shell interprets $1 and $2, replacing them with the first two arguments in the current context (so probably the empty string in both cases, given the error youre getting). You should use single quotes:awk '{ print $1-$2; }'