I just want to substract the 2nd column from the first, I did
awk "{ print $1-$2; }"
I get a syntax error. For information, input is piped in from another process.
Since you’re 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 you’re getting). You should use single quotes:
awk '{ print $1-$2; }'