Bird
0
0

Why does the here string operator <<< add a newline character to the input it sends?

hard🧠 Conceptual Q10 of 15
Bash Scripting - Text Processing in Scripts
Why does the here string operator <<< add a newline character to the input it sends?
ABecause it appends output to a file
BBecause it reads from a file that ends with newline
CBecause it runs the command in a new shell
DBecause it simulates a line of input ending with newline
Step-by-Step Solution
Solution:
  1. Step 1: Understand here string input behavior

    The here string sends the string as if typed on a line, so it adds a newline at the end.
  2. Step 2: Compare with other options

    It does not read from a file, run a new shell, or append output to a file.
  3. Final Answer:

    Because it simulates a line of input ending with newline -> Option D
  4. Quick Check:

    Here string adds newline to simulate line input [OK]
Quick Trick: Here strings add newline to simulate line input [OK]
Common Mistakes:
MISTAKES
  • Thinking it reads from a file
  • Confusing input with output redirection
  • Assuming no newline is added

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes