πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      Which command will read input line-by-line from a file

      in a shell script?
      A while read line; do ... done < filename Correct Answer Incorrect Answer
      B cat filename | while read line Correct Answer Incorrect Answer
      C Both A and B Correct Answer Incorrect Answer
      D readline filename Correct Answer Incorrect Answer
      E read < filename Correct Answer Incorrect Answer

      Solution

      Both syntax styles use the read command inside a loop to process each line of a file sequentially.

      Practice Next
      ask-question