From: Nico Kadel-Garcia
To: CentOS mailing list
Sent: Thu, March 17, 2011 6:31:15 AM
Subject: Re: [CentOS] ssh remote execute awk problem
>> grep ^processor /proc/cpuinfo | wc -l
>> Or:
>> ssh -l $TARGETUSER $TARGETHOST "
On 3/17/2011 9:43 AM, m.r...@5-cent.us wrote:
>
>>>
>>>ssh -l $TARGETUSER $TARGETHOST "[ -e /proc/cpuinfo ] -a grep
>>> ^processor | wc -l"
>>
>> Or, more extremely - if you are doing much of this kind of remote
>> inventory checking, you might consider running ocsinventory-ng with
>> agent
Les Mikesell wrote:
> On 3/17/2011 8:31 AM, Nico Kadel-Garcia wrote:
>>
>>> Quote the whole command and backslash the command quotes...
>>> ssh root@localhost "awk '/processor/{count[\"proc\"]++}; END{print
>>> count[\"proc\"] } ' /proc/cpuinfo"
>>
>> Or do the processing locally and stay away from
On 3/17/2011 8:31 AM, Nico Kadel-Garcia wrote:
>
>> Quote the whole command and backslash the command quotes...
>> ssh root@localhost "awk '/processor/{count[\"proc\"]++}; END{print
>> count[\"proc\"] } ' /proc/cpuinfo"
>>
>> JD
>
> Or do the processing locally and stay away from proc nuttiness,
>
On Thu, Mar 17, 2011 at 9:31 AM, Nico Kadel-Garcia wrote:
> On Thu, Mar 17, 2011 at 6:58 AM, John Doe wrote:
>> From: sync
>>>There is a problem on executing awk command to remote servers;
>>> 1. #!/bin/sh
>>> 2.
>>> 3. _CMD="ssh root@localhost"
>>> 4.
>>> 5. cpu_num="$($_CMD awk
On Thu, Mar 17, 2011 at 6:58 AM, John Doe wrote:
> From: sync
>>There is a problem on executing awk command to remote servers;
>> 1. #!/bin/sh
>> 2.
>> 3. _CMD="ssh root@localhost"
>> 4.
>> 5. cpu_num="$($_CMD awk '/processor/{count["proc"]++}; END{print
>>count["proc"]}' /proc/cpu
From: sync
>There is a problem on executing awk command to remote servers;
>1. #!/bin/sh
>2.
>3. _CMD="ssh root@localhost"
>4.
>5. cpu_num="$($_CMD awk '/processor/{count["proc"]++}; END{print
>count["proc"]}' /proc/cpuinfo)“
>6.
>7. echo $cpu_num
Quote the whole c
Hi , all :
There is a problem on executing awk command to remote servers;
The shell test script is like this :
1. #!/bin/sh
2.
3. _CMD="ssh root@localhost"
4.
5. cpu_num="$($_CMD awk '/processor/{count["proc"]++}; END{print
count["proc"]}' /proc/cpuinfo)“
6.
7. echo $c
8 matches
Mail list logo