I want to sort the input of the user with sort in a case (and function).
But I never used this before. Do I have to use an array or something?
For example the user does:
bash test.sh 50 20 35 50
Normally in my script this would happen:
ping c -1 "192.168.0.$i"
That results in
192.168.0.50
192.168.0.20
192.168.0.35
192.168.0.50
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.
SortNumbers(){
}
...
case
-sort ) SortNumbers;;
esac