Which of the following commands will set the variable text to olaf is home?

Which of the following commands will set the variable text to olaf is home? (Select TWO answers)

Which of the following commands will set the variable text to olaf is home? (Select TWO answers)

A.
text=olaf\ is\ home

B.
text=$olaf is home

C.
$text=’olaf is home’

D.
text==’olaf is home’

E.
text=”olaf is home”



Leave a Reply 5

Your email address will not be published. Required fields are marked *


Harin

Harin

i dont think this is the correct answer

My ans is ‘E’

Harin

Harin

Can any body please help

n3

n3

A and E
Answer A
Linux does not comprehend “white space” (Space Bar characters). However a \ (Back-slash) tells the Bash to expect a Space bar character. As a result
text=olaf\ is\ home will set the variable

Answer E
This is the usual method for creating variables, again “white space” needs to be addressed and it is with the “double quotes” which tells the Bash, to include everything within the double quotes.

The other answers are wrong because they use the wrong syntax. Know that A & E are correct and they are in the correct syntax