exam questions

Exam 010-160 All Questions

View all questions & answers for the 010-160 exam

Exam 010-160 topic 1 question 66 discussion

Actual exam question from LPI's 010-160
Question #: 66
Topic #: 1
[All 010-160 Questions]

Which of the following examples shows the general structure of a for loop in a shell script?

  • A. for *.txt as file => echo $file
  • B. for *.txt ( echo $i )
  • C. for file in *.txt do echo $i done
  • D. for ls *.txt exec {} \;
  • E. foreach @{file} { echo $i }
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
sasquatchshrimp
Highly Voted 1 year, 3 months ago
This is correct. It would be easier if there was proper spacing, but I believe they are looking for the do and done, which makes the other answers wrong.
upvoted 12 times
...
beazzlebub
Most Recent 7 months, 3 weeks ago
C is the correct answer
upvoted 2 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