When I want to run my parameter with -sort
after it, I need to sort all the other parameters that I mention with it. Example
. MyScript.sh -sort Tree Apple Boolean
The output should need to be
Apple Boolean Tree
I tried to make an array and run through all the parameters but this didn't work out
Array=()
while (( "$#" ))
do
Array += "$1"
shift
done
This also had the problem that I couldn't ignore the -sort
.