Recall & Review
beginner
How do you convert a string to uppercase in Bash?
Use the syntax:
${string^^}. For example, name="hello"; echo ${name^^} outputs HELLO.Click to reveal answer
beginner
How do you convert a string to lowercase in Bash?
Use the syntax:
${string,,}. For example, name="HELLO"; echo ${name,,} outputs hello.Click to reveal answer
intermediate
What does
${string^} do in Bash?It converts only the first character of the string to uppercase. For example,
name="hello"; echo ${name^} outputs Hello.Click to reveal answer
intermediate
What does
${string,} do in Bash?It converts only the first character of the string to lowercase. For example,
name="HELLO"; echo ${name,} outputs hELLO.Click to reveal answer
beginner
Why is uppercase and lowercase conversion useful in scripting?
It helps standardize text input, making scripts more reliable when comparing or processing strings regardless of how users type them.
Click to reveal answer
Which syntax converts the entire string to uppercase in Bash?
✗ Incorrect
The syntax ${string^^} converts all characters in the string to uppercase.
What will
echo ${name,,} output if name="HELLO"?✗ Incorrect
The syntax ${string,,} converts the entire string to lowercase.
How do you convert only the first letter of a string to uppercase in Bash?
✗ Incorrect
The syntax ${string^} converts only the first character to uppercase.
What does
${string,} do in Bash?✗ Incorrect
The syntax ${string,} converts only the first character to lowercase.
Why should you convert input text to a consistent case in scripts?
✗ Incorrect
Converting text to a consistent case helps avoid errors when comparing or processing strings.
Explain how to convert a string to uppercase and lowercase in Bash using parameter expansion.
Think about the double caret and double comma syntax.
You got /4 concepts.
Why is it important to standardize text case in automation scripts?
Consider how users might type input differently.
You got /3 concepts.