A thing is $
expanded by the shell before being passed to the team ssh
. You should deprive him of his special importance locally, avoiding it before passing it on ssh
as a
ssh -t login@machine watch "ps aux | awk '{print \$1}' | grep php-fpm | wc -l"
, , , , $1
, , , awk
.
, awk
grep
ssh -t login@machine watch "ps aux | awk '\$1 == \"php-fpm\"{count++}END{print count}'