Narayana
Narayana

Reputation: 333

Bash,Postfix, AWK, Error in filtering deferred mail output

This is what I have tried so far:

cat /var/spool/postfix/deferred/D3B921090 | awk -F"/" '{print $6}' |awk '{$1="" print $0}' | sort | uniq -c | sort -n

and

awk -F"/" '{print $6}' < /var/spool/postfix/deferred/D3B921090 | awk '{$1="" print $0}' | sort | uniq -c | sort -n

I get the following error message when trying to run either command:

awk: line 1: syntax error at or near print

What am I doing wrong?

Upvotes: 1

Views: 269

Answers (1)

Adrian Fr&#252;hwirth
Adrian Fr&#252;hwirth

Reputation: 45656

awk '{$1="" print $0}'

is not a syntactically valid expression, did you mean

awk '{$1=""; print $0}'

which is equal to

awk '{$1=""}1'

?

Upvotes: 2

Related Questions