shell if 判断匹配1位数字

#!/bin/bash
[[ $1 =~ ^[0-9]$ ]] && echo 1 || echo 0

 

posted @ 2021-12-01 16:59  忙碌在路上  阅读(160)  评论(0编辑  收藏  举报