IF so fourth and so on equals to whatever (if theres a match here then the script halts, next in line checks if theres ElseIF statement)
ElseIF so fourth and so on equals to whatever (if theres a match here the script halts, next in line checks if theres another elseif statement if not jumps to else)
Else (if theres no match from the IF or ElseIF statement then whatever execution you have in your else statement will execute)
You can always not add an ELSE statement its not neccasary unless your script needs to perform something in the end if no matches were found.
alias ifs {
if ($$1 == 1) { echo -a IF statement stops numeric match: 1 }
elseif ($$1 == 2) { echo -a ElseIF statement stops numeric match: 2 }
elseif ($$1 == 3) { echo -a ElseIf statement stops numeric match: 3 }
else { echo -a The numerical value has no match }
}
Type /ifs to execute the command and type a numerical value after such has 1 up to 3
1 if the IF statement, 2 is an elseif statement, 3 is an elseif statement, any other number is the else statement has you see it never jumps to else unless theres no matches in the if/elseif statements