DispersedNet
SiteMap
Unix Concepts
Shell Programming
Shell Scripting
Unix Questions
Shell Variables
«Prev
Next»
Shell Programming
Shell Programming
Unix Shell Available
Determining Unix Shell
Shell Scripts Unix
Interpreted Compiled Programs
Understanding Scripting Options
Shell Compiled Programs
Shell Programming Conclusion
Shell Components
Shell Script Macro
Built in Components
Input Output Tools
Shell Script Tests
Script Variables
shell-script-control-structures
Regex Define Patterns
Shell Program Components
Writing First Script
Interactive Shell Script
Defining Script File
Using Text Editor
Echo Command Display Data
Read Input Command
Including Comments Scripts
Setting File Permissions
Running Command Line
First Script Conclusion
Working With Variables
Command Line Arguments
Predefined System Variables
System Variables
Environment Variables
Syntax Affects Interpretation
Using Strings Variables
Using Numbers-inVariables
Performing Math Variables
Using Array Variables
Scripts Variable Summary
Designing Scripts
Script Objective
Script Flow
loop Tests
Checking Commands
error Trapping
Making Script Portable
Documenting Script
Designing Shell Scripts
Shell Variables and Environment Variables - Quiz
Each question is worth one point. Select the best answer or answers for each question.
1.
How can environment variables be accessed within a shell script?
Please select the best answer.
A.
By using the
set
command
B.
By using the
export
command
C.
By referring to the variable name preceded by a dollar sign
D.
By referring to the variable name within any
echo
command
2.
What is the HOME environment variable?
Please select the best answer.
A.
A system-defined environment variable
B.
A positional parameter used with all system accounts
C.
A special variable that refers to network settings
D.
A variable that is not returned to the parent shell
3.
What does the #$ system variable refer to?
Please select the best answer.
A.
The process ID of the script being run
B.
All of the parameters on the command line (as a single string of text)
C.
The path of the shell interpreter used to execute the script
D.
The number of arguments in the command line that started the script.
4.
Which of the following statements are true of positional parameters?
Please select all the correct answers.
A.
They can be checked for validity before proceeding with a script.
B.
They are referenced by a number preceded by a dollar sign.
C.
They can be used in place of environment variables.
D.
They can be used within any command in a shell script.