Exercise
Consider the following script. Rewrite it with the case
statement.
#!/bin/bash
if [[ "$1" = "Alice" ]]
then
echo "Hello Alice"
elif [[ "$1" = "Bob" ]]
then
echo "Hello Bob"
else
echo "Hello John Doe"
fi
Click on the Run button after making any changes in the file.
Get hands-on with 1200+ tech skills courses.