How do you read a loop file in Unix?

Lê Minh

Member
How do you read a loop file in Unix?
Answer
Looping through the content of a file in Bash
  1. # Open vi Editor vi a_file. txt # Input the below lines Monday Tuesday Wednesday Thursday Friday Saturday Sunday # cat the file cat a_file. txt. …
  2. #!/bin/bash while read LINE do echo “$LINE” done < a_file. txt. …
  3. #!/bin/bash file=a_file. txt for i in `cat $file` do echo “$i” done.
 

Tìm kiếm

Back
Top