- Add single quotes to the following line so that it displays as shown.
If other quoting is neccessary, you may add it, too.
$ echo 'the value of $x is:' $x
the value of $x is: 10
- Add double quotes to the following line so that it displays as shown.
If other quoting is neccessary, you may add it, too.
$ echo "the value of \$x is: $x"
the value of $x is: 10
- Add backslashes to the following line so that it displays as shown.
If other quoting is neccessary, you may add it, too.
$ echo the value of \$x is: $x
the value of $x is: 10
- Add single quotes to the following line so that it displays as shown.
If other quoting is neccessary, you may add it, too.
$ echo 'Some special characters are: $ % & \ *'
Some special characters are: $ % & \ *
- Add double quotes to the following line so that it displays as shown.
If other quoting is neccessary, you may add it, too.
$ echo "Some special characters are: \$ % & \\ *"
Some special characters are: $ % & \ *
- Add backslashes to the following line so that it displays as shown.
If other quoting is neccessary, you may add it, too.
$ echo Some special characters are: \$ \% \& \\ \*
Some special characters are: $ % & \ *
- Add backslashes to quotes to the following line so that it displays as expected. The double quotes and the first dollar sign
should be displayed. $total is a variable whos value should be displayed.
$ echo The \"total\" sale is \$$total.
The "total" sale is $9.95.
- Add double quotes to the following line so that it displays as expected. The double quotes and the first dollar sign
should be displayed. $total is a variable whos value should be displayed.
$ echo "The \"total\" sale is \$$total."
The "total" sale is $9.95.
- Add single quotes to the following line so that it displays as expected. The double quotes and the first dollar sign
should be displayed. $total is a variable whos value should be displayed.
$ echo 'The "total" sale is $'$total.
The "total" sale is $9.95.
- Break the following command onto two lines between the words "is" and "too".
$ echo This line is \
> too long.
- Break the following command onto two lines between the words "is" and "too".
$ echo "This line is \
> too long."
- Use command substitution to achive the desired output. The file name is names.
$ echo There are $(cat names | wc -l) lines in the file.
There are 14230 lines in the file.
Bonus:
- Use command substitution to achive the disired output. Get the information from the file names.
$ echo The most common name is \
> $(cut -f1 -d' ' names | sort | uniq -c | \
> sort -nr | head -1| cut -c8-).
The most common name is JAMES.
(The line breaks are not neccessary. They are only inserted so the text will fit in the box on smaller screens.)