1

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.

1 Answer 1

2

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; }'
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.