exam questions

Exam 101-500 All Questions

View all questions & answers for the 101-500 exam

Exam 101-500 topic 1 question 98 discussion

Actual exam question from LPI's 101-500
Question #: 98
Topic #: 1
[All 101-500 Questions]

Which of the following commands outputs test to the shell?

  • A. cat test

    EOT -
  • B. cat <|EOT
    test

    EOT -
  • C. cat !test

    EOT -
  • D. cat &test

    EOT -
  • E. cat <test

    EOT -
Show Suggested Answer Hide Answer
Suggested Answer: E 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
benjmcy
Highly Voted 2 years, 1 month ago
the command is cat << EOT >test >EOT
upvoted 20 times
mvpVN
1 year, 4 months ago
bash 'heredoc' for research.
upvoted 2 times
...
...
Roger95
Highly Voted 8 months ago
Selected Answer: E
E is correct #cat <<ENDofTEXT >test >ENDofTEXT
upvoted 5 times
...
Lazylinux
Most Recent 3 months, 1 week ago
Selected Answer: E
Tested for sure E, EOT can be anything i.e. Linux as long as it is typed last to end the text input
upvoted 1 times
...
Vendo
1 year, 10 months ago
its just a kind of label. you can use any word in that place. some popular usage are ftp, database processing etc. Code: ftp -inv $host << FTP ## start of label, below command will be treated as ftp command not the shell commans user $user $passwd bin put $file bye FTP # end of ftp commands ls ## shell commands again https://www.unix.com/shell-programming-and-scripting/128056-command-eot.html
upvoted 2 times
...
pablex_wolf
2 years, 1 month ago
None worked for me on Ubuntu. Anyone can explain why E would be correct? I prompts input when you run the string
upvoted 2 times
Penguinofdarkness
4 months, 1 week ago
with EOT [enter] you start an input of text. you'll get a new line to type your text and can add lines by pressing enter. afterwards you close the input with another EOT that will output the whole text in between those EOTs. the cat << will put that output into your shell, like a print
upvoted 5 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago