Exam 7: Working With the Bash Shell

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Describe what file descriptors are, and then list three that can be used within the BASH shell, and discuss how they can be used.

Free
(Essay)
4.8/5
(42)
Correct Answer:
Verified

Command input and output are represented by labels known as file descriptors. For each command that can be manipulated by the BASH shell, there are three file descriptors:
Standard input (stdin)
Standard output (stdout)
Standard error (stderr)
Standard input (stdin) refers to the information processed by the command during execution; this often takes the form of user input typed on the keyboard. Standard output (stdout) refers to the normal output of a command, whereas standard error (stderr) refers to any error messages generated by the command. Both stdout and stderr are displayed on the terminal screen by default.

The ____________________ environment variable contains a list of directories to search for executable programs.

Free
(Short Answer)
4.8/5
(44)
Correct Answer:
Verified

PATH

A list of all exported environment and user-defined variables in a shell can be viewed with what command below?

Free
(Multiple Choice)
4.8/5
(33)
Correct Answer:
Verified

A

The ability to extract, manipulate, and format text using pattern action statements belongs to which command below?

(Multiple Choice)
4.8/5
(32)

​What two BASH environment variables represent the current working directory, and the absolute pathname of the current shell, respectively?

(Multiple Choice)
4.8/5
(45)

What environment file is always executed immediately after login for all users on the system, and sets most environment variables, such as HOME and PATH?

(Multiple Choice)
4.8/5
(36)

In an if construct, what statements are optional?​

(Multiple Choice)
4.9/5
(34)

What permissions are required to execute a shell script in a manner similar to any other executable program on the system?

(Multiple Choice)
4.9/5
(35)

​Match each correct item with the statement below.​ a.​counter variable b.decision construct​ c.​environment variables d.​file descriptors e.​hashpling f.loop construct​ g.​redirection h.Standard Error (stderr)​ i.​Standard Input (stdin) j.Standard Output (stdout) -​A special construct used in a shell script to alter the flow of the program based on the outcome of a command or contents of a variable. Common decision constructs include if, case, &&, and ||.

(Short Answer)
4.9/5
(30)

What number represents the stdin file descriptor?

(Multiple Choice)
4.8/5
(36)

Select the escape sequence that starts a new line when used with echo:

(Multiple Choice)
4.8/5
(34)

The default BASH shell prompt is set by an environment variable. What command can be used to view this variable?

(Multiple Choice)
4.7/5
(35)

​What operator below is known as the NOT operator?

(Multiple Choice)
4.9/5
(31)

Any command that can be executed on the command line can also be placed inside any environment file.

(True/False)
4.8/5
(29)

What character is used to delimit most Linux configuration files?

(Multiple Choice)
4.8/5
(37)

Given the syntax command && command, the command on the left of the && construct is executed only if the command on the right of the && construct completed successfully.

(True/False)
4.8/5
(38)

Explain the while construct, and demonstrate how it can be used.

(Essay)
4.8/5
(31)

The standard output and standard error from a terminal screen within the BASH shell can be redirected to a file on the filesystem using what shell metacharacter, followed by the absolute or relative pathname of the file?

(Multiple Choice)
4.7/5
(38)

Select the test statement that can be used to determine if A is numerically greater than B:

(Multiple Choice)
4.9/5
(26)

Select the escape sequence that is used for a form feed:

(Multiple Choice)
4.7/5
(36)
Showing 1 - 20 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)