Question: QUESTION 1 The test command has two formats: test expression test with no arguments returns a false (1) [ expression ] the expression must be

QUESTION 1

The test command has two formats:

test expression

test with no arguments returns a false (1)

[ expression ]

the expression must be seen by test

there must be a space surrounding the brackets

True

False

6 points

QUESTION 2

In the case statement, the shell will always match the best match, not the first matching case.

True

False

10 points

QUESTION 3

The following will never return a syntax error from test:

[ -f $FILENAME ]

True

False

10 points

QUESTION 4

PATH is the environment variable which represents your search path. The shell looks along PATH to find where an executable file is located as it tries to execute a command from the command line. If there is dot (.) on your PATH, the shell will look in the current directory for the command. The shell searches PATH from left to right. It is a colon separated list.

If there is a : at the beginning of PATH, that is an implied dot (.) --> same as .:

If there is a : at the end of PATH, that is an implied dot same as :.

If there is a :: in the PATH, that is the an implied dot same as :.:

I want you to match the case statement pattern to the correct description.

- A. B. C.

:*|.:*)

- A. B. C.

*:|*:.)

- A. B. C.

*::*|*:.:*)

A.

There is a . at the begining of the PATH

B.

There is a . at the end of the PATH

C.

There is a dot somewhere in the middle of my PATH

30 points

QUESTION 5

In the case statement, you don't need to use quoting to protect the characters from interpretation from the shell.

True

False

10 points

QUESTION 6

The case statement can not be used to do string comparision

True

False

6 points

QUESTION 7

In the case statement match pattern and description.

- A. B. C. D.

*)

- A. B. C. D.

?)

- A. B. C. D.

[chars])

- A. B. C. D.

[!chars])

A.

matches any character not in the character set

B.

matches zero or more characters

C.

matches any single character

D.

matches any character in the character set

28 points

Click Save and Submit to save and submit. Click Save All Answers to save all answers.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!