title: stderr and stdout of ssh?
body: <p>i am not clear about the stdout and stderr of ssh beacasuse if i execute say :</p>
  
  <p>ssh user@remotemachine_ip  "some command"
  i get the output instantly on the screen or may be some error</p>
  
  <p>1.loged in with ssh </p>
  
  <p>2.remote commands are executed on the remote machine</p>
  
  <p>3.the output is displayed on the remote machine (stderr or stdout) which i can see.
  then its comes back to local machine.</p>
  
  <p>or</p>
  
  <p>the output come back to the local machine's stdout and which can be appended to a file on local machine.</p>
  
  <p>so if i have a for loop in local machine</p>
  
  <pre><code>for i in ip1 ip2
  do
  ssh user@remotemachine_ip  "some command" 
  done
  </code></pre>
  
  <p>what is the best way for error redirection and is it dependent on for,while,until loops</p>
  
  <p>what if instead of ssh i am using some expect script</p>
  
  <p><code>expectscript.exp user@remotemachine_ip  "some command"</code></p>