shell if 判断匹配1位数字

#!/bin/bash
[[ $1 =~ ^[0-9]$ ]] && echo 1 || echo 0
可随意转载,欢迎署名!
原文地址:https://www.cnblogs.com/netsa/p/15629778.html