Bird
0
0

In bash scripting, which logical operator is used to represent OR inside single square brackets [ ]?

easy🧠 Conceptual Q1 of 15
Bash Scripting - Conditionals
In bash scripting, which logical operator is used to represent OR inside single square brackets [ ]?
A-o
B-a
C||
D&&
Step-by-Step Solution
Solution:
  1. Step 1: Understand logical operators inside [ ]

    Inside single square brackets, bash uses -o for OR and -a for AND.
  2. Step 2: Identify the OR operator

    The operator -o means OR inside [ ]. The symbols || and && are used outside [ ].
  3. Final Answer:

    -o -> Option A
  4. Quick Check:

    Logical OR inside [ ] = -o [OK]
Quick Trick: Use -o for OR inside [ ], not || or && [OK]
Common Mistakes:
MISTAKES
  • Confusing -o with -a
  • Using || inside [ ]
  • Using && instead of -a

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes