Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to unset the variable named my_var.
Bash Scripting
unset [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word 'unset' as the variable name.
Using a wrong variable name like 'var' or 'variable'.
✗ Incorrect
The
unset command removes the variable named my_var from the environment.2fill in blank
mediumComplete the code to unset the variable temp in a script.
Bash Scripting
unset [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to unset a variable with a similar but incorrect name.
Using a plural or extended form of the variable name.
✗ Incorrect
The
unset command removes the variable named exactly temp.3fill in blank
hardFix the error in the code to properly unset the variable data.
Bash Scripting
unset [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using $ before the variable name in unset.
Using special characters like * or & before the variable name.
✗ Incorrect
When unsetting a variable, do not use the dollar sign. Just write the variable name.
4fill in blank
hardFill both blanks to unset the variable count and then print its value.
Bash Scripting
unset [1] echo $[2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names in unset and echo.
Trying to unset with a wrong variable name.
✗ Incorrect
First, unset the variable named
count. Then, echo its value using $count.5fill in blank
hardFill all three blanks to unset variables a and b, then print a.
Bash Scripting
unset [1] [2] echo $[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Unsetting only one variable instead of two.
Echoing a variable not unset or not declared.
✗ Incorrect
You can unset multiple variables by listing them. Then echo the variable
a.