gpt4 book ai didi

linux - 在 case 语句中使用数值范围

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:17:56 24 4
gpt4 key购买 nike

<分区>

我在执行案件时遇到了麻烦。每次,它都会转到最后一个案例,即 * 字符。

这是我正在使用的:

case $used_space in
[1-84])
echo "OK - $used_space% of disk space used."
exit 0
;;
[85])
echo "WARNING - $used_space% of disk space used."
exit 1
;;
[86-100]*)
echo "CRITICAL - $used_space% of disk space used."
exit 2
;;
*)
echo "$used_space% of disk space used."
exit 3
;;
esac

如何更改我的 case 语句以使用数字范围?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com