This quiz is part of the DevOpsTheHardWay course.

Please answer the quiz and click the "Test" button at the bottom right.

Bash - Variables - multichoice questions

Question 1

Which of the following commands would append the directory /opt/bin to the current value of the PATH environment variable?

Question 2

Which of the following commands would create a file called jan_reports.txt?

Question 3

Which command would display the current shell’s process id (pid)?

Question 4

Which of the following is not a feature of environment variables?

Question 5

Which ones(s) of the following would correctly set the shell variable ADDR to 123_Elm_St.?

Question 6

The user elvis performs the following command:

[elvis@station elvis]$ STYLE=terse

Which of the following commands could be used to examine the value of STYLE?

Question 7

Which of the following command lines would create a file called make $ at home!?

Question 8

What is the output of this code?

VAR="/var/www/html/website.com/html/"
echo "${VAR#*/html}"

Question 9

What is the output of this script?

#!/bin/bash
fname=john
john=thomas
echo ${!fname}

Question 10

When used from within a script, which variable contains the name of the script?

license