Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的代码:
if [ $value == "^[[:digit:]]*$" ] then echo "number" else echo "other" fi
即使我设置了value=1.
value=1
test不做正则表达式。
test
[[ $value =~ ^[0-9]+$ ]]