I get syntax error from awk command when querying a remote server
by brh1 from LinuxQuestions.org on (#5N0P7)
Good day.
This query on a local host works just fine:
Code:-bash-4.2$ df -P | awk '0+$5 >=40 {print}'
/dev/mapper/vg00-root 8125880 4679656 3010412 61% /
/dev/vda1 245671 132995 95473 59% /bootI get a syntax error from awk from remote server with this query:
Code:-bash-4.2$ ssh -q 192.168.210.20 "df -P | awk '0+$5 >=40 {print}'"
awk: cmd. line:1: 0+ >=40 {print}
awk: cmd. line:1: ^ syntax errorI've tried using backslashes, single and double quotes, but can't find the right answer.
Please advise.
Bjoern
This query on a local host works just fine:
Code:-bash-4.2$ df -P | awk '0+$5 >=40 {print}'
/dev/mapper/vg00-root 8125880 4679656 3010412 61% /
/dev/vda1 245671 132995 95473 59% /bootI get a syntax error from awk from remote server with this query:
Code:-bash-4.2$ ssh -q 192.168.210.20 "df -P | awk '0+$5 >=40 {print}'"
awk: cmd. line:1: 0+ >=40 {print}
awk: cmd. line:1: ^ syntax errorI've tried using backslashes, single and double quotes, but can't find the right answer.
Please advise.
Bjoern