using -sort in linux <p>I want to sort the input of the user with <code>sort</code> in a case (and function). But I never used this before. Do I have to use an array or something?</p> <p>For example the user does:</p> <pre><code>bash test.sh 50 20 35 50 </code></pre> <p>Normally in my script this would happen:</p> <pre><code>ping c -1 "192.168.0.$i" </code></pre> <p>That results in </p> <pre><code>192.168.0.50 192.168.0.20 192.168.0.35 192.168.0.50 </code></pre> <p>Now I want that the last numbers are sorted and also pinged from smallest to the biggest number like this: 20 35 50 and also that if you have 2 times the same number, the script only pings that number one time.</p> <pre><code>SortNumbers(){ } ... case -sort ) SortNumbers;; esac </code></pre>