Linux/Bash Shell Script

숫자 check script

준섭이 2023. 12. 26. 13:41
728x90

### 숫자가 아닐 시, check script

#!/bin/sh

input=$1

if [ $(echo $input | egrep "[0-9]+") ]; then
	if [ $input -lt 50 ]; then
    	echo "$input ins number"
    else
    	echo "*** 파라메터 값을 50보다 작게 하세요!!"
    fi
else
	echo "$input is not number!!"
fi