I need to fill an array and find out what the highest value is, which I've done. With this code:
full=($LASTOCT[*])
for i in $LASTOCT
do
echo $i
done
echo "Highest value is: $(printf "%d\n" ${full[*]} | sort -n | tail -1) "
My question is that no matter what number is in the last element of the array, I always get this error: ./ipcheck: line 16: printf: 134[*]: invalid number
Any ideas of what might be causing this? Thanks in advance!