[CentOS] ssh remote execute awk problem
John Doe
jdmls at yahoo.comThu Mar 17 10:58:36 UTC 2011
- Previous message: [CentOS] ssh remote execute awk problem
- Next message: [CentOS] ssh remote execute awk problem
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: sync <jiannma at gmail.com> >There is a problem on executing awk command to remote servers; > 1. #!/bin/sh > 2. > 3. _CMD="ssh root at localhost" > 4. > 5. 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 at localhost "awk '/processor/{count[\"proc\"]++}; END{print count[\"proc\"] } ' /proc/cpuinfo" JD
- Previous message: [CentOS] ssh remote execute awk problem
- Next message: [CentOS] ssh remote execute awk problem
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list