Nguyễn Hồng Nhung
New member
How do I read a text file in Unix?
Answer
Syntax: Read file line by line on a Bash Unix & Linux shell:
Answer
Syntax: Read file line by line on a Bash Unix & Linux shell:
- The syntax is as follows for bash, ksh, zsh, and all other shells to read a file line by line.
- while read -r line; do COMMAND; done < input.file.
- The -r option passed to read command prevents backslash escapes from being interpreted.