gpt4 book ai didi

bash - 如何在 Bash 中进行不区分大小写的字符串比较?

转载 作者:行者123 更新时间:2023-12-05 08:14:34 26 4
gpt4 key购买 nike

<分区>

我的脚本:

echo "input yes or no"
read a
if [ $a = "yes" ] or [ $a = "Yes" ] or [ $a = "YES" ];
then
command
else
command
done

我想先转换答案(使用 tr A-Z a-z 命令),然后再与字符串进行比较...这样可以吗?

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