Task

Create a function that returns the maximum value in a provided set of values,

where the number of values may not be known until run-time.




max() {
  local m=$1
  shift
  while [ $# -gt 0 ]
  do
    [ "$m" -lt "$1" ] && m=$1
    shift
  done
  echo "$m"
} 
 
max 10 9 11 57 1 12