On 04/10/2017 11:30 AM, JD wrote:
On 04/10/2017 10:32 AM, Gordon Messmer wrote:
On 04/09/2017 07:25 PM, JD wrote:
ssh user_foo@1.2.3.4 "pgrep -f 'master_app' | wc -l" 2> stderr.log
Those stderr messages would be coming from wc and NOT from ssh.
The OP's command should be
ssh user_foo@1.2.3.4 2> stderr.log "pgrep -f 'master_app' | wc -l"
You did not understand.
The ssh command is executed LOCALLY and it's stderr is on the local machine. So, the OP will divert the LOCAL stderr to a LOCAL file so that he can see if the
LOCAL ssh command experienced any issues with the connection.
Capiche?????

I did understand. It doesn't matter if 2>file appears before the ssh arguments, or at the end. In both cases, ssh's stderr will be written to a local file. It is incorrect to say that the former example would redirect wc's stderr, and not ssh.
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

Reply via email to