shell学习笔记

判断是否是数字字母组合

#!/bin/bash
echo $1  
if echo "$1" | grep -qv '^[a-zA-Z0-9]\+$'; then  
    echo "Error!!"
    exit -1
fi  
echo "success"