Saturday, March 27, 2010

UNIX Shell 에서 if, elif(else if), else, fi 사용 및 condition 비교문

if문 사용법:
echo "num args : $#"
if [ $# -eq 3 ]; then
echo "arg3:"$3
elif [ $# -eq 2 ]; then
echo "arg2:"$2
else
echo "exception"
fi
비교문 :
is equal to: eq
is not equal to: ne
is greater than: gt
is less than: lt
is greater than or equal to: ge
is less than or equal to: le
레퍼런스 : if...elif...fi condition in Unix

No comments:

Post a Comment