Sort Array Ascending

Sort an array of numbers in ascending order.

Code

General
echo "$arr" | tr -d '[]' | tr ',' '\n' | sort -n | tr '\n' ' ' | sed 's/ $//'

Parameters

JSON array of numbers

Server

More Bash Snippets