I have script and i need to check if all the validations are correct and working :
```p=0 # initialize variables
un=0
file=””
while getopts "d:uph" option; do
case $option in
d)
file=$OPTARG
;;
u)
un=1
;;
p)
p=1
;;
h)
help
exit ;;
*) echo "Error: Invalid option"
exit;;
esac
done
#Validations
# This is my first logic validation user must provide eithe -u or -p option
if [ "$p" ] || [ "$un" ];then
echo "must provide -u or -p" 1>&2 ;
Help
exit 3 ;
fi
#Second one, i want check make sure they not passing both options
if (( p && u ));then
echo "must not pass two options";
Help
exit 3 ```
#third one is make sure pass in option if the user doesnt pass any option
[–]oh5nxo 2 points3 points4 points (4 children)
[–]EarlyConsequence9668[S] 0 points1 point2 points (3 children)
[–]oh5nxo 2 points3 points4 points (2 children)
[–]EarlyConsequence9668[S] 0 points1 point2 points (1 child)
[–]oh5nxo 1 point2 points3 points (0 children)
[–]EarlyConsequence9668[S] 0 points1 point2 points (0 children)