PrepAway - Latest Free Exam Questions & Answers

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)

PrepAway - Latest Free Exam Questions & 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”

5 Comments on “Which of the following commands will set the variable text to olaf is home?

      1. n3 says:

        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




        0



        0

Leave a Reply