Skip to content

Shell Scripting Intermediate – Full Quiz

Back to Quiz Home


This quiz contains 20 questions focused on Loops, Arrays, Conditionals, and File Operations. Mastering these concepts is crucial for writing robust automation scripts.


#

Which loop is best for iterating over a known list of items?

#

How do you define an array in Bash?

#

How do you access the first element of an array named arr?

#

Which command prints all elements of an array?

#

Which loop executes as long as the condition is true?

#

Which loop executes as long as the condition is false?

#

How do you perform an arithmetic comparison for "equal to" in [ ]?

#

Which operator checks if a string is empty?

#

Which command is used to increment a variable i?

#

How do you iterate through all .txt files in a directory?

#

What does the continue statement do?

#

How do you read a file line by line?

#

Which logical operator represents "AND" in [[ ]]?

#

Which logical operator represents "OR" in [[ ]]?

#

How do you check if a file is writable?

#

How do you calculate the length of an array?

#

How do you check if a variable VAR is set (not empty)?

#

How do you define a range in a for loop?

#

What is the proper syntax for an arithmetic condition?

#

How do you break out of an infinite loop?

Quiz Progress

0 / 0 questions answered (0%)

0 correct


📚 Study Guides


📬 Weekly DevOps, Cloud & Gen AI quizzes & guides