Docs/shell/比较参数最大值.md
2022-10-18 16:59:37 +08:00

18 lines
No EOL
233 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

10个参数输出最大值
```shell
#!/bin/bash
if [ $# -lt 10 ];then
exit 1
else
temp=0
while [ -n "$1" ];do
if [[ $temp -gt $1 ]];then
temp=$temp
else
temp=$1
fi
shift
done
fi
echo $temp
```