linux arguments variables usage

2023-06-14,,

#! /bin/bash
if [ $# -ne 1 ];then
echo "please input one argument:"
exit 1
fi

if [ $1 -eq 1 ];then
echo "you input is $1."
elif [ $1 -eq 2 ];then
echo "you input is $1."
else
echo "you input is wrong."
exit 2
fi

《linux arguments variables usage.doc》

下载本文的Word格式文档,以方便收藏与打印。