QUESTION 1 The test command has two formats: test expression test with no argume
ID: 3904147 • Letter: Q
Question
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.
:*|.:*)
*:|*:.)
*::*|*:.:*)
There is a . at the begining of the PATH
There is a . at the end of the PATH
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.
*)
?)
[chars])
[!chars])
matches any character not in the character set
matches zero or more characters
matches any single character
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.
- 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
Explanation / Answer
Please Note: As per Chegg Answering Guidelines, I have answered the first question. Please Post Separate for Separate Questions.
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
Answer)
The test command has two formats - True, it has 2 formats -
test expr
[ expr ]
test expression - True, correct format
test with no arguments returns a false - True
[ expression ] - True, correct format
the expression must be seen by test - True
there must be a space surrounding the brackets - True, spaces are important and thus each operator and operand must be separated by a space.
QUESTION 2
In the case statement, the shell will always match the best match, not the first matching case.
True
False
Answer)
False, The case statement will always match the first case and then case terminates with the exit status
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.