我需要检查路径是否包含'*'字符作为最后一位数字.
我的方法:
length=${#filename} ((filename--)) #use substring to get the last character if [ ${img:$length:1} == "*"] ;then echo "yes" fi
这会返回"[:太多参数"错误.
我究竟做错了什么?
string bash
bash ×1
string ×1