#!/bin/ksh
# Scriptname: are_you_ok
print "Are you ok (y/n) ?"
read answer
if [ "$answer" = Y -o "$answer" = y ] # Old-style test
then
print "Glad to hear it."
fi
****************************************************************
#!/bin/ksh
# Scriptname: are_you_ok2
print "Are you ok (y/n) ?"
read answer
if [[ "$answer" = [Yy]* ]] # New-style test
then
print "Glad to hear it."
fi
阅读(451) | 评论(0) | 转发(0) |