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:
for var in "$@"
do
echo -n "$var "
done | sort -rn
However when I added the -n to the echo the sort command stops working. I am trying to do this without using printf. Using the echo -n they do not sort and simply print in the order they were entered.
printf? AFAIK, usuallyechowith arguments isn't portable.