Hi All,
Im trying to find the count of process running on remote server using SSH.
Below command dosen't work.
ssh -q user@host "ps -ef | grep "pattern" | grep -v 'grep' | awk '{print $2}'|wc -l"
But below command works.
ssh -q user@host "ps -ef | grep "pattern" | grep -v 'grep' | awk '{print \$2}'|wc -l"
the difference between 2 commands is $ was eacaped in second command.
Can any one explain the concept why we should escape $.