Bird
0
0

What does the file descriptor number 0 represent in bash scripting?

easy🧠 Conceptual Q1 of 15
Bash Scripting - File Operations in Scripts
What does the file descriptor number 0 represent in bash scripting?
AStandard error (stderr)
BStandard output (stdout)
CStandard input (stdin)
DA temporary file descriptor
Step-by-Step Solution
Solution:
  1. Step 1: Understand file descriptor basics

    File descriptor 0 is always assigned to standard input in bash and Unix-like systems.
  2. Step 2: Match descriptor to stream

    Standard output is 1, standard error is 2, so 0 must be standard input.
  3. Final Answer:

    Standard input (stdin) -> Option C
  4. Quick Check:

    File descriptor 0 = Standard input [OK]
Quick Trick: Remember: 0=stdin, 1=stdout, 2=stderr [OK]
Common Mistakes:
MISTAKES
  • Confusing 0 with standard output
  • Thinking 0 is standard error
  • Assuming 0 is a temporary descriptor

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes