Explain the behavior of the following shell script:

The assignment statement assigns a string that contains a NEWLINE to the vari-
able twoliner. Because the NEWLINE is quoted, it does not end the command but

rather becomes part of the string assigned to twoliner. The first echo com-

6

mand encloses the variable within quotation marks, causing the shell to
interpret the NEWLINE not as a special character but rather as itself. The echo
command therefore displays two lines. The second echo command does not
quote the variable. The shell therefore interprets the NEWLINE as whitespace,
causing echo to display the string with a SPACE in place of the NEWLINE.

Computer Science & Information Technology

You might also like to view...

________ software is used to block unauthorized access to your computer

Fill in the blank(s) with correct word

Computer Science & Information Technology

To conserve space laptop computers often use a small knob, called a(n) ________ as the pointing device

Fill in the blank(s) with correct word

Computer Science & Information Technology