On Sun, Apr 9, 2017 at 10:49 PM, Samuel Sieb <[email protected]> wrote:
> On 04/09/2017 07:25 PM, JD wrote:
>>
>> On 04/09/2017 06:02 PM, Samuel Sieb wrote:
>>>
>>> ssh [email protected] "pgrep -f  'master_app' | wc -l" 2> stderr.log
>>>
>>> would write any errors to the file "stderr.log" on the local box.
>>
>> Those stderr messages would be coming from wc and NOT from ssh.
>> The OP's command should be
>>
>> ssh [email protected] 2> stderr.log "pgrep -f  'master_app' | wc -l"
>
>
> That's exactly the same as the one I wrote.  If I had included the "2>" part
> inside of the quotes, then it would do as you say.
>

===========
Ok...

So if I get what you guys have said...

 ssh  [email protected] 2>&1   pgrep -f  'master_client' | wc -l

would work with the >> 2>&1 << writing the stderr to the stdout for the ssh

and at the same time the
  >>   pgrep -f  'master_client' | wc -l <<
is being run on the remote box..

or is it that the
  >>   pgrep -f  'master_client' <<
is run on the remote box..

with the
  >>   wc -l <<
then being run on the local box..


by the way, when running

 ssh  [email protected] 2>&1   "pgrep -f  'master_client' | wc -l"

is the pgrep inside the "" being all run on the remote? and if it is,
any idea why the count is 1 more than when i do a ssh into the box and
then run the
>> pgrep -f  'master_client' | wc -l <<


thanks guys!




> _______________________________________________
> users mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to