title: When redirecting in bash to stdout or stderr, I actually get redirected to a file
body: <p>I'm saving the output of one command executed on a remote via ssh, but I also execute some echos. In order to see the messages on the screen and not save them to the variable I want to redirect them. 
  I have tried >&amp;1 and >&amp;2 but in each case a file is created with the name either "1" or "2"
  Is this an issue of expanding quotes or escaping characters?</p>
  
  <pre><code>OUTPUT=$(sshpass -p password ssh user@ip 'echo "Message1" &gt;&amp;2 ;
                                            su -lc "./rootscript.sh" &gt;&amp;2; 
                                            echo "$?" ')
  echo "su output is: $OUTPUT"
  </code></pre>
  
  <p>Output: </p>
  
  <p>Nothing on screen, a file named "2" with the text "Password" inside (assuming Message 1 was overwritten) The program still waits for a password, even without a prompt, so when I enter it the output is good:</p>
  
  <pre><code>su output is: 0
  </code></pre>
  
  <p>How can I get my messages to show on screen?</p>