Recall & Review
beginner
What is the main purpose of conditionals in a script?
Conditionals let the script choose different actions based on whether a condition is true or false. This helps the script make decisions like a person would.Click to reveal answer
beginner
How does a conditional 'branch' affect script flow?
A branch splits the script into different paths. The script follows one path if the condition is true, and another if it is false.
Click to reveal answer
beginner
Give a simple real-life example of a conditional decision.
Like deciding to take an umbrella if it is raining. The condition is 'Is it raining?'. If yes, take umbrella; if no, don't.
Click to reveal answer
beginner
What bash keyword starts a conditional statement?
The keyword 'if' starts a conditional statement in bash scripts.
Click to reveal answer
intermediate
Why is branching important in automation scripts?
Branching lets automation scripts handle different situations automatically, making them flexible and smart.
Click to reveal answer
What does a conditional statement in a script do?
✗ Incorrect
Conditionals let the script pick different actions depending on whether a condition is true or false.
Which bash keyword is used to start a conditional?
✗ Incorrect
'if' is the keyword to start a conditional statement in bash.
What happens if a condition in a script is false?
✗ Incorrect
If the condition is false, the script runs the else branch if it exists, or skips the if block.
Why do scripts need branching?
✗ Incorrect
Branching lets scripts react differently depending on conditions, making them flexible.
Which of these is NOT a conditional branch in bash?
✗ Incorrect
'for' is a loop, not a conditional branch.
Explain why conditionals are important in scripting and how they change the script's behavior.
Think about how you decide what to do based on yes/no questions.
You got /3 concepts.
Describe a simple real-life example that shows how a conditional branch works.
Use everyday choices like weather or traffic.
You got /3 concepts.