NOS 120 Final UPDATED ACTUAL QUESTIONS AND CORRECT ANSWERS
Your organization routinely uses scripts, but as some Require that script writers place comment lines inside the scripts using the #
employees have left, there are scripts that contain only symbol to begin each comment line.
command lines and no one is certain of their
purpose.What steps can be taken to ensure a way for
others to know the purpose of a script?
Which of the following shells enables the use of scripts? Bash
(Choose all that apply.) csh
zsh
You frequently use the command ls -a and want to save alias l=" ls -a"
time by just entering l to do the same thing.Which of the
following commands enables you to set your system to
view hidden files by only entering l ?
You have written a script, but when you run it there is an sh -v
error. Which of the following commands can you use to sh -x
debug your script? (Choose all that apply.)
You have written a shell program that creates four trap
temporary files.Which of the following commands can
you use to remove these files when the script has
completed its work?
Which of the following commands works well for menus case
used in a script? (Choose all that apply.)
, You are currently in the source directory, which is the new echo $PATH
directory you have just created for storing and running
your scripts.You want to make certain that the source
directory is in your default path.Which of the following
commands enables you to view the current default path
settings?
You have created a script for use by your entire You did not give all users in your department execute permission for that script.
department in a commonly accessed directory. Only you
are able to run the script, which works perfectly.Which of
the following is likely to be the problem?
Your current working directory contains a series of files more account[ a,b,c,d,e ]
that start with the word "account" combined with a, b, c,
d, and e, such as accounta, accountb, and so on. Which
of the following commands enables you to view the
contents of all of these files? (Choose all that apply.)
For which of the following logic structures used within a if
script is fi the final line for that logic structure? (Choose
all that apply.)
Which of the following are examples of arithmetic or !
relational operators? (Choose all that apply). <
%
*
You have created a series of scripts that use the same You need to use the export command so these variables have global use.
environment variables. However, when you run these
scripts, some of them do not seem to recognize the
environment variables you have set. What is the problem?
You have spent the last two hours creating a report in a Enter the command, set -o noclobber before you start.
file and afterwards you use cat to create a new file.
Unfortunately the new file name you used was the same
as the name you used for the report, and now your
report is gone.What should you do next time to prevent
this from happening?
You have remotely logged into a computer running UNIX OSTYPE
or Linux, but you are not certain about which operating
system you are using. However, when you display the
contents of the variable it shows which operating system
you are using.
What command can you use to view the environment and printenv
configuration variables already configured on your
system?
Your organization routinely uses scripts, but as some Require that script writers place comment lines inside the scripts using the #
employees have left, there are scripts that contain only symbol to begin each comment line.
command lines and no one is certain of their
purpose.What steps can be taken to ensure a way for
others to know the purpose of a script?
Which of the following shells enables the use of scripts? Bash
(Choose all that apply.) csh
zsh
You frequently use the command ls -a and want to save alias l=" ls -a"
time by just entering l to do the same thing.Which of the
following commands enables you to set your system to
view hidden files by only entering l ?
You have written a script, but when you run it there is an sh -v
error. Which of the following commands can you use to sh -x
debug your script? (Choose all that apply.)
You have written a shell program that creates four trap
temporary files.Which of the following commands can
you use to remove these files when the script has
completed its work?
Which of the following commands works well for menus case
used in a script? (Choose all that apply.)
, You are currently in the source directory, which is the new echo $PATH
directory you have just created for storing and running
your scripts.You want to make certain that the source
directory is in your default path.Which of the following
commands enables you to view the current default path
settings?
You have created a script for use by your entire You did not give all users in your department execute permission for that script.
department in a commonly accessed directory. Only you
are able to run the script, which works perfectly.Which of
the following is likely to be the problem?
Your current working directory contains a series of files more account[ a,b,c,d,e ]
that start with the word "account" combined with a, b, c,
d, and e, such as accounta, accountb, and so on. Which
of the following commands enables you to view the
contents of all of these files? (Choose all that apply.)
For which of the following logic structures used within a if
script is fi the final line for that logic structure? (Choose
all that apply.)
Which of the following are examples of arithmetic or !
relational operators? (Choose all that apply). <
%
*
You have created a series of scripts that use the same You need to use the export command so these variables have global use.
environment variables. However, when you run these
scripts, some of them do not seem to recognize the
environment variables you have set. What is the problem?
You have spent the last two hours creating a report in a Enter the command, set -o noclobber before you start.
file and afterwards you use cat to create a new file.
Unfortunately the new file name you used was the same
as the name you used for the report, and now your
report is gone.What should you do next time to prevent
this from happening?
You have remotely logged into a computer running UNIX OSTYPE
or Linux, but you are not certain about which operating
system you are using. However, when you display the
contents of the variable it shows which operating system
you are using.
What command can you use to view the environment and printenv
configuration variables already configured on your
system?