Bird
0
0

What is the default number of positions shifted when you run shift without any argument in a bash script?

easy🧠 Conceptual Q2 of 15
Bash Scripting - User Input
What is the default number of positions shifted when you run shift without any argument in a bash script?
A0
B1
C2
DDepends on the number of arguments
Step-by-Step Solution
Solution:
  1. Step 1: Recall default behavior of shift

    When no number is given, shift shifts by one position.
  2. Step 2: Confirm no other default applies

    It never shifts zero or two by default; it always shifts one.
  3. Final Answer:

    1 -> Option B
  4. Quick Check:

    shift default = 1 [OK]
Quick Trick: Shift without number moves one argument [OK]
Common Mistakes:
MISTAKES
  • Assuming shift defaults to zero
  • Thinking shift depends on argument count
  • Believing shift defaults to two

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes