for example, if I want to write a script that get strings as arguments, and I want to insert them to array array_of_args
and then I want to sort this array and to make sorting array.
How can I do it?
I thought to sort the array (and print it to stdout) in the next way:
array_of_args=("$@")
# sort_array=()
# i=0
for string in "${array_of_args[@]}"; do
echo "${string}"
done | sort
But I don't know how to insert the sorting values to array ( to sort_array
)..