Bird
0
0

What will be the output when you run this script named hello.sh?

medium📝 Command Output Q4 of 15
Bash Scripting - Basics
What will be the output when you run this script named hello.sh?
#!/bin/bash
echo "Hello, World!"
AHello, World!
Bhello.sh
CError: command not found
DNo output
Step-by-Step Solution
Solution:
  1. Step 1: Understand the echo command in the script

    The script uses echo to print the string "Hello, World!" to the terminal.
  2. Step 2: Predict the output of running the script

    Running the script will display exactly "Hello, World!" on the screen.
  3. Final Answer:

    Hello, World! -> Option A
  4. Quick Check:

    echo prints text = Hello, World! [OK]
Quick Trick: echo prints text to terminal in bash scripts [OK]
Common Mistakes:
MISTAKES
  • Expecting filename as output
  • Thinking script errors without syntax issues
  • Expecting no output when echo is used

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes