Bird
0
0

What is the output of this bash script?

medium📝 Command Output Q4 of 15
Bash Scripting - String Operations
What is the output of this bash script?
text="BashScript"
echo ${text,,}
ABashScript
Bbashscript
CBASHCRIPT
DbashScript
Step-by-Step Solution
Solution:
  1. Step 1: Understand the script

    The variable text contains "BashScript". The expression ${text,,} converts all characters to lowercase.
  2. Step 2: Predict output

    All letters become lowercase, so output is "bashscript".
  3. Final Answer:

    bashscript -> Option B
  4. Quick Check:

    Lowercase conversion output = bashscript [OK]
Quick Trick: Double commas ,, convert all letters to lowercase [OK]
Common Mistakes:
MISTAKES
  • Expecting only first letter lowercase
  • Confusing uppercase and lowercase syntax
  • Ignoring case conversion operator

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes