I'm trying to make a script that sort's numbers that are passed as parameters.( bubblesort)
declare -a EXITNUMBERS
if [ $# -lt $MINPARAMETERS ]
echo "The script needs at least " $MINPARAMETERS
echo "The value of the parameters before the sorting:"
for (( h=1 ; h <= $# ; h++ ))
for (( i=1 ; i <= $# ; i++ ))
if [ $j -ge $((j+1)) ]
echo "The value of the parameters after sorting"
The problem is that I can't find the right syntaxis for:
$[j+1] or $((j+1))
in the nested for-loop.
I'm working with ubuntu.
If you see any other mistakes or have tips, I would appreciate it.
0 · ·