Online Activities, Educational Games, Quizzes, Crossword Maker

Make educational games, websites, online activities, quizzes and crosswords with Kubbu e-learning tool for teachers

Alternative content for non-flash browsers:

Chapter 8

1. What does %3e%3e accomplish when entered on the command line after a command?
imported, validated by running the env command, exported, redirected to the BASH shell,
2. How do you indicate a comment line in a shell script?
3. 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?
/etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile,
4. Which of the following file descriptor numbers represents stdout?
a. ls /var, env, set, echo,
5. The alias command can be used to make a shortcut to a single command. True or False?
end, endif, stop, fi,
6. Every if construct begins with if and must be terminated with?
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 is not necessarily generated by every command on the system? (Choose all that apply.)
echo HOME=, echo ~, echo $HOME, echo ls HOME,
8. Which of the following will display the message welcome home if the cd /home/user1 command is successfully executed?
2, 0, 1, 3,
9. What is wrong with the following command string ls /etc/hosts %3elistofhostfile?
#!, -o, -a, !,
10. Which command could you use to see a list of all environment and user-defined shell variables as well as their current values?
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. 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?
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., You must specify a new file each and every time you redirect as the system creates the specified file by default.,
13. Which of the following operators reverses the meaning of a test statement?
TRUE, FALSE, computer assisted language learning ,
14. The sed and awk commands are filter commands commonly used to format data within a pipe. 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., The file listofhostfile will always only contain Standard Error as a file descriptor was not declared.,
15. The current value for the HOME variable is displayed by which of the following commands? (Choose all that apply.)
Standard Input, Standard Deviation, Standard Ouput, Standard Error,
16. Which construct can be used in a shell script to read Standard Input and place it in a variable?
read, sum, verify, test,
17. Before a user-defined variable can be used by processes that run in subshells, that variable must be __________.
not begin with a number, not begin with a capital letter, start with a number, start with an underscore “_”al),
18. 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?
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., It appends Standard Ouput to a file.,