Suppose I want to read two inputs say x and y. And as per values of them I want to execute switch case in Bash script.
Say 4 combinations of inputs are
x=0,y=0,x=0,y=1,x=1,y=0,x=1,y=1.
But I don't know how to do it using script. I have tried the code but its getting syntax error. Is it possible to combine two conditions in switch case for Bash script?
echo "enter x"
read x
echo "enter y"
read y
case "$x" "$y" in
"zero" "zero") echo "condtion 1"
;;
"zero" "one") echo "conditon 2"
;;
"one" "zero" ) echo "condition 3"
;;
"one" "one") echo "condition 4"
;;
esac