Cloud & DevOps · Question 30 · Hard
What does this shell command print?
false && echo A || echo B
- A
- B
- A, then B on the next line
- Nothing
Answer and explanation
Answer: B. B
Explanation: false exits with a non-zero status, so the && part (echo A) is skipped. The || part runs because the preceding command failed, so only B is printed.
Previous: What does this shell pipeline print?
Practise cloud & devops
Try a fresh set of cloud & devops questions with an explanation after every answer, free and without signing up: Cloud & DevOps practice. Or sit a full placement mock test.
More cloud & devops questions
- A request must pass through a web server and then a database server, and both…
- When does a cron job with the schedule 30 2 * * 1 run?
- What does this shell pipeline print?
More technical & programming practice
GenAI Basics · Pseudo-code · C Programming · Java · Python · Data Structures · Algorithms · Object-Oriented Programming
LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge