#!/bin/bash
while :
do
read -p "Please input a number: " n
n1=`echo $n|sed 's/[0-9]//g'`
if [ -z $n1 ]
then
echo $n
exit 0
else
continue
fi
done
本文转自 linuxpp 51CTO博客,原文链接:http://blog.51cto.com/1439337369/1715596,如需转载请自行联系原作者