Question
1. Which statement is NOT true regarding regular expression quantifiers? a.The question mark quantifier ? will match the preceding element exactly one time b.They can
1. Which statement is NOT true regarding regular expression quantifiers?
a.The question mark quantifier "?" will match the preceding element exactly one time
b.They can operate on groups and character classes
c.In order to use a plus sign "+" quantifier as a literal character, you must first 'escape' it using a backslash '\' character
d.They act on the preceding pattern element
2. "[0-9]?" is an equivalent expression to "[0-9]{0,1}"
T/F ?
3. Assume the following conditions are true;
- the file "script.sh" exists
- the current working directory is not in the PATH
- script.sh has its execution bit enabled
- script.sh contains a valid #! line with BASH as its interpreter
Which of the following is not a valid command to invoke script.sh?
a. . ./script.sh
b. script.sh
c. ./script.sh
d. bash script.sh
e. none
4. Which of the following is not true about this invocation of echo and its output;
a. The -e option tells echo to expand the $1 variable name
b. The $ character can be escaped to allow the original string to be rendered
c.The shell is removing the $1 before echo evaluates the string
d.The positional parameter is empty
5. The script provided will have no output; why?
1 #!/bin/bash 2 declare -l MYVAR 3 MYVAR='ORB' 4 if [ $MYVAR -eq "ORB" ]; then 5 VAR1=3 6 echo $MYVAR 7 fi
a.he MYVAR variable does not contain 'ORB'
b.The $MYVAR on line 4 is incorrect; it should be MYVAR without the $
c.line 7 is misspelled; it should be 'if' not 'fi'
d.Lines 5 and 6 are not properly indented
e.On line 4, the = (equals) operator must be used
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started