可以这样写
#!/bin/bashif [ $# -lt 1 ]; then echo "Enter your numbers" exit 1fiMAXNUM=`for i in $*; do echo $i; done | sort -nr | head -1`echo "The maximum number is: $MAXNUM"
测试结果
$ sh test.sh 1 56 0 92The maximum number is: 92