From: sync jiannma@gmail.com
There is a problem on executing awk command to remote servers;
- #!/bin/sh
- _CMD="ssh root@localhost"
- cpu_num="$($_CMD awk '/processor/{count["proc"]++}; END{print
count["proc"]}' /proc/cpuinfo)“ 6. 7. echo $cpu_num
Quote the whole command and backslash the command quotes... ssh root@localhost "awk '/processor/{count["proc"]++}; END{print count["proc"] } ' /proc/cpuinfo"
JD