bash jika lain
# Basic syntax
if [[ condition_1 ]]; then
echo "Code to execute if condition_1 is true"
elif [[ condition_2 ]]; then
echo "Code to execute if condition_1 is false and condition_2 is true"
else
echo "Code to execute if condition_1 and condition_2 are false"
fi
# Note, the syntax for the one-line equivalent is:
if [[ condition_1 ]]; then echo "Code to execute if condition_1 is true"; elif [[ condition_2 ]]; then echo "Code to execute if condition_1 is false and condition_2 is true"; else echo "Code to execute if condition_1 and condition_2 are false"; fi
# Note to self, see this link for more on bash operators and [ ] vs [[ ]]:
# https://tldp.org/LDP/abs/html/comparison-ops.html
Charles-Alexandre Roy