Chapter 81. What is wrong with the following command string ls /etc/hosts %3elistofhostfile?
imported, validated by running the env command, exported, redirected to the BASH shell,
2. 13. You have redirected Standard Error to a file called Errors. You view the contents of this file afterward and notice that there are six error messages. After repeating the procedure, you notice that there are only two error messages in this file. Why?
TRUE, FALSE, ,
3. Which of the following file descriptor numbers represents stdout?
/etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile,
4. How do you indicate a comment line in a shell script?
a. ls /var, env, set, echo,
5. Which construct can be used in a shell script to read Standard Input and place it in a variable?
end, endif, stop, fi,
6. The sed and awk commands are filter commands commonly used to format data within a pipe. True or False?
cd /home/user1 %26%26 echo “welcome home”, cat “welcome home” || cd /home/user1, cd /home/user1 || cat “welcome home”, echo “welcome home” %26%26 cd /home/user1,
7. Which of the following will display the message welcome home if the cd /home/user1 command is successfully executed?
echo HOME=, echo ~, echo $HOME, echo ls HOME,
8. Which of the following is not necessarily generated by every command on the system? (Choose all that apply.)
2, 0, 1, 3,
9. What would be the effect of using the alias command to make an alias for the date command named cat in honor of your favorite pet?
#!, -o test , -a, !,
10. The current value for the HOME variable is displayed by which of the following commands? (Choose all that apply.)
It cannot be done as there already is an environment variable cat associated with the cat command., It cannot be done as there already is a command cat on the system., When you use the cat command at the command prompt with the intention of viewing a text file, the date appears instead., There is no effect until the alias is imported as it is a user-declared variable.,
11. What does %3e%3e accomplish when entered on the command line after a command?
There are no comment lines in a shell script., Begin the line with #!., Begin the line with !., Begin the line with #.,
12. A variable identifier must _________.
After you open the file and view the contents, the contents are lost., The system generated different Standard Ouput., You did not append the Standard Error to the Error file and as a result, it was overwritten when the command was run a second time. quiz generator , You must specify a new file each and every time you redirect as the system creates the specified file by default.,
13. Because Standard Error and Standard Ouput represent the results of a command and Standard Input represents the input required for a command, only Standard Error and Standard Ouput can be redirected to/from a file. True or False?
TRUE, FALSE, ,
14. The alias command can be used to make a shortcut to a single command. True or False?
Nothing is wrong with the command., The file descriptor was not declared; unless 1 for Standard Ouput or 2 for Standard Error is indicated, the command will fail., The ls command is one of the commands that cannot be used with redirection; you must use | to pipe instead. learning , The file listofhostfile will always only contain Standard Error as a file descriptor was not declared.,
15. Which command could you use to see a list of all environment and user-defined shell variables as well as their current values?
Standard Input, Standard Deviation, Standard Ouput, Standard Error,
16. Before a user-defined variable can be used by processes that run in subshells, that variable must be __________.
read, sum, verify, test,
17. Every if construct begins with if and must be terminated with?
not begin with a number, not begin with a capital letter, start with a number, start with an underscore “_”al),
18. Which of the following operators reverses the meaning of a test statement?
It redirects both Standard Error and Standard Ouput to the same location., It does not accomplish anything., It redirects Standard Error and Standard Input to the same location. help students assimilate material , It appends Standard Ouput to a file.,