Question: QUESTION 1 The following command prints out the first character of the text stored in the shell variable MYVAR: echo $MYVAR | sed -e 's/.*(.)$/1/'
QUESTION 1
| The following command prints out the first character of the text stored in the shell variable MYVAR: |
| echo "$MYVAR" | sed -e 's/.*\(.\)$/\1/' |
True
False
20 points
QUESTION 2
Choose the correct output for each of the echo statements given the following:
| STREET="1 University Ave" | |
| CITY="Lowell" | |
| STATE="MA" | |
| ADDRESS="$STREET | NOTE: there should be a new line after the $STREET |
| $CITY, $STATE" | |
|
|
30 points
QUESTION 3
Given the following shell variable assignments:
| STREET="59 Lowes Way" |
| CITY="Lowell" |
STATE="MA" |
ADDRESS='$STREET |
$CITY, $STATE' |
| The command, |
| echo "$ADDRESS" |
| Will display the following: |
| 59 Lowes Way |
| Lowell, MA |
True
False
10 points
QUESTION 4
| If the shell variable TESTME was defined as follows, |
| TESTME="0123456789" |
| The following command would echo 11 |
| echo "$TESTME" | wc -c |
True
False
20 points
QUESTION 5
Given the following commands:
| P1="Hello world I am here" |
| P1=`echo "$P1" | tr '\t' ' ' | sed -e 's/[ ]//g'` |
| echo "$P1" |
| The result of the last echo statement will be |
| Hello world I am here |
True
False
20 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
Get step-by-step solutions from verified subject matter experts
