0
0
Bash Scriptingscripting~10 mins

Uppercase and lowercase conversion in Bash Scripting - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to convert the variable 'text' to uppercase using parameter expansion.

Bash Scripting
echo "$[1]"
Drag options to blanks, or click blank then click option'
Atext^^
Btext,,
Ctext^
Dtext,,,
Attempts:
3 left
💡 Hint
Common Mistakes
Using single caret (^) converts only the first character.
Using double commas (,,) converts to lowercase instead.
Adding extra commas or carets causes syntax errors.
2fill in blank
medium

Complete the code to convert the variable 'text' to lowercase using parameter expansion.

Bash Scripting
echo "$[1]"
Drag options to blanks, or click blank then click option'
Atext,,
Btext^^
Ctext^
Dtext,,,
Attempts:
3 left
💡 Hint
Common Mistakes
Using double carets (^^) converts to uppercase instead.
Using single caret (^) converts only the first character.
Adding extra commas causes syntax errors.
3fill in blank
hard

Fix the error in the code to convert only the first character of 'text' to uppercase.

Bash Scripting
echo "$[1]"
Drag options to blanks, or click blank then click option'
Atext^^
Btext^
Ctext,
Dtext,,
Attempts:
3 left
💡 Hint
Common Mistakes
Using double carets (^^) converts all letters, not just the first.
Using double commas (,,) converts to lowercase.
Using a comma alone is invalid syntax.
4fill in blank
hard

Fill both blanks to convert the variable 'word' to lowercase and then print it.

Bash Scripting
lowercase_word="$[1]"
echo "$[2]"
Drag options to blanks, or click blank then click option'
Aword,,
Bword^^
Clowercase_word
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase conversion instead of lowercase.
Printing the original variable instead of the lowercase one.
Mixing variable names causing undefined variable errors.
5fill in blank
hard

Fill all three blanks to create a script that reads input into 'input_text', converts it to uppercase, and prints it.

Bash Scripting
read -p "Enter text: " [1]
uppercase_text="$[2]"
echo "$[3]"
Drag options to blanks, or click blank then click option'
Ainput_text
Binput_text^^
Cuppercase_text
Dinput_text,,
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase conversion instead of uppercase.
Printing the original input variable instead of the uppercase one.
Forgetting to assign the read input to a variable.