Challenge - 5 Problems
Automation Pattern Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of a loop pattern in Bash
What is the output of this Bash script?
Bash Scripting
for i in {1..3}; do echo "Step $i"; done
Attempts:
2 left
💡 Hint
Look at how the loop prints each step on a new line.
✗ Incorrect
The for loop runs from 1 to 3, echoing 'Step' followed by the number each time on a new line.
🧠 Conceptual
intermediate2:00remaining
Why use patterns in automation scripts?
Which reason best explains why using common patterns helps in automation scripting?
Attempts:
2 left
💡 Hint
Think about how reusing solutions affects reliability.
✗ Incorrect
Using patterns means you reuse solutions that are already tested, reducing mistakes and saving time.
📝 Syntax
advanced2:00remaining
Identify the correct Bash pattern for checking file existence
Which option correctly checks if a file named 'data.txt' exists in Bash?
Attempts:
2 left
💡 Hint
Remember the correct syntax for the test command and if statement.
✗ Incorrect
Option D uses the correct test syntax with single brackets and proper if statement structure.
🔧 Debug
advanced2:00remaining
Find the error in this automation script snippet
What error does this Bash script produce?
code:
count=0
while [ $count -lt 3 ]
do
echo "Count is $count"
count=$count+1
done
Attempts:
2 left
💡 Hint
Check how the count variable is updated inside the loop.
✗ Incorrect
The expression 'count=$count+1' does not perform arithmetic in Bash; it assigns a string, so count never increases.
🚀 Application
expert2:00remaining
Automate file backup with timestamp pattern
Which Bash command correctly copies 'report.txt' to a backup file with the current date appended (format YYYY-MM-DD)?
Attempts:
2 left
💡 Hint
Check the correct syntax for date formatting in command substitution.
✗ Incorrect
Option A uses the correct date format with '+' and proper year format for a backup filename.