title: Sorting on Same Line Bash
body: <p>Hello I am trying to sort a set of numeric command line arguments and then echo them back out in reverse numeric order on the same line with a space between each. I have this loop:</p>
  
  <pre><code>for var in "$@"
  do
  echo -n "$var "
  done | sort -rn
  </code></pre>
  
  <p>However when I added the <code>-n</code> to the echo the <code>sort</code> command stops working. I am trying to do this without using <code>printf</code>. Using the <code>echo -n</code> they do not sort and simply print in the order they were entered.</p>