QUESTION 3 The following will never return a syntax error from test: [ -f $FILEN
ID: 3904913 • Letter: Q
Question
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 3
The following will never return a syntax error from test:
[ -f $FILENAME ]
True
False
Answer)
True
The test command is used for conditional execution os shell command.
The syntax is
test EXPRESSION
or
[ EXPRESSION ]
EXPRESSION will be the [ -f $FILENAME ] which is valid where $FILENAME will be replaced by the FILENAME.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.