0
0
Bash Scriptingscripting~10 mins

Unsetting variables (unset) 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 unset the variable named my_var.

Bash Scripting
unset [1]
Drag options to blanks, or click blank then click option'
Amy_var
Bunset
Cvar
Dvariable
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word 'unset' as the variable name.
Using a wrong variable name like 'var' or 'variable'.
2fill in blank
medium

Complete the code to unset the variable temp in a script.

Bash Scripting
unset [1]
Drag options to blanks, or click blank then click option'
Atemps
Btemporary
Ctmp
Dtemp
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.
3fill in blank
hard

Fix 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'
A*data
B$data
Cdata
D&data
Attempts:
3 left
💡 Hint
Common Mistakes
Using $ before the variable name in unset.
Using special characters like * or & before the variable name.
4fill in blank
hard

Fill 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'
Acount
Cvalue
Dvar
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names in unset and echo.
Trying to unset with a wrong variable name.
5fill in blank
hard

Fill 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'
Aa
Bb
Dc
Attempts:
3 left
💡 Hint
Common Mistakes
Unsetting only one variable instead of two.
Echoing a variable not unset or not declared.