Complete the code to display the value of the HOME environment variable.
echo $[1]The HOME environment variable stores the path to the current user's home directory. Using echo $HOME prints this path.
Complete the code to set a new environment variable named MY_VAR with the value 'hello'.
export [1]='hello'
export so the variable is not available to other programs.To create an environment variable, use export followed by the variable name and its value. Here, MY_VAR is the variable name.
Fix the error in the code to append ':~/bin' to the PATH environment variable.
export PATH=$PATH:[1]To add a directory to PATH, prepend or append the directory path. Here, ~/bin is the directory to add. The correct syntax is export PATH=$PATH:~/bin.
Fill both blanks to create a variable named COUNT with value 5 and print it.
export [1]=[2] echo $COUNT
First, set the variable name COUNT to the value 5 using export. Then, echo $COUNT prints the value.
Fill all three blanks to create a variable named USERNAME with the current user and print a greeting.
export [1]=$(whoami) echo "Hello, $[2]! Your shell is $[3]."
Set USERNAME to the current user using $(whoami). Then print a greeting using $USERNAME and the SHELL environment variable.