공부
[Sh] count parameter
승가비
2020. 5. 17. 21:13
728x90
if [ "$#" -eq 2 ]
then
echo "Its works!"
else
echo "need to two params"
exit 1
fi
https://stackoverflow.com/questions/4341630/checking-for-the-correct-number-of-arguments
Checking for the correct number of arguments
How do i check for the correct number of arguments (one argument). If somebody tries to invoke the script without passing in the correct number of arguments, and checking to make sure the command l...
stackoverflow.com
728x90