Read a file field by field
suggest changeLet’s assume that the field separator is :
(colon) in the file file.
while IFS= read -d : -r field || [ -n "$field" ]; do echo "$field" done <file
For a content:
first : se con d: Thi rd: Fourth
The output is:
**first ** ** se con d** ** Thi rd** ** Fourth **
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents