Please help as i want to validate arguments passed while executing the script .
What i want that user can only give values as parameter those are valid as per script.
./script.sh abc xyz where abc is a folder location which can be any location and xyz is either yes or no. if user enter any other word apart from yes or no then my message should be displayed and exit there only.
sample given below:
if [ $# -eq 2 ]; then
if (($test1 == "audit") || ($test1 == "insert")); then
echo "" or continue with the main script
echo "please pass arguments like sample - Sample: ./script.sh b1 audit. "
echo "invalid argument please pass only 2 argument "
echo "Sample: ./script.sh b1 audit"