DispersedNet
SiteMap
Unix Concepts
Shell Programming
Shell Scripting
Unix Questions
Unix Shell Scripts
«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 Script File Permissions - Quiz
Each question is worth one point. Select the best answer or answers for each question.
1.
Why does executing a shell script require either a period-slash (./) or the
sh
command?
Please select the best answers.
A.
It ensures that the script can be located and executed correctly.
B.
The period makes the script a hidden file for secure execution.
C.
The PATH variable must be referred to in order to locate the shell script.
D.
The
sh
command starts a shell regardless of whether the included filename is a script or not.
2.
Why are comments useful within scripts? Choose all correct answers:
Please select all the correct answers.
A.
To guide others who might be using your scripts.
B.
To remind you of what your script does when you review it months later.
C.
To provide self documenting variables.
D.
To make the script easier to read by breaking up command blocks with white space.
3.
How can you determine the file permissions of a script file?
Please select the best answers.
A.
By using the
echo
command to write that information to the screen.
B.
By using the
chmod
command to print the permissions.
C.
By using the
read
command to collect new file permissions from the system administrator.
D.
By using the
ls -l
command to view the detailed listing of the script filename.
4.
Which of these commands will set the correct file permission for a script file named welcome:
Please select the best answers.
A.
ls -lx welcome
B.
chmod o-x welcome
C.
chmod a+x welcome
D.
chmod u+x welcome.sh