Correct option is B
In Linux shell scripting, the $ symbol is used to reference the value of a variable. For example, if a variable is defined as VAR="Hello", the value can be accessed using $VAR. This symbol is essential for variable manipulation and accessing environment variables in scripts.
Example:
Important Key Points:
1. $ references variables, such as user-defined or environment variables (e.g., $HOME, $PATH).
2. It is also used for
special positional parameters in shell scripting, such as $1, $2 for arguments passed to a script.
3. The $ symbol in the command prompt represents a
regular user shell, whereas # is used for the root user shell.
Knowledge Booster:
·
To denote a superuser prompt: Incorrect; $ is used for normal users, while # is for superuser prompts.
·
To execute a command in the background: Incorrect; the & symbol is used for background execution.
·
To suppress error messages: Incorrect; 2>/dev/null is used to suppress error messages.
·
To concatenate strings: Incorrect; string concatenation is done without any special symbols in Bash.