/dev/null &&echo "$str"|grep "[0-9]" >/dev/null then echo "yes"else echo "no"fi ..." />

shell编程,输入一个字符串,判断是否是数字。

read a if [[ $a =~ /\-?[0-9][0-9.]+/]] ; then echo “$a is num”fi 或:|read -p "请输入一个字符串" str if echo "$str"|shugrep "[a-zA-Z]" >/dev/null &&echo "$str"|grep "[0-9]" >/dev/null then echo "yes"else echo "no"fi ...
shell编程,输入一个字符串,判断是否是数字。
mengvlog 阅读 7 次 更新于 2025-07-19 19:13:57 我来答关注问题0
檬味博客在线解答立即免费咨询

编程相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部