Read a simple text file by using a shell script


Very simple shell script in bash to read a text file line by line. The script uses a while loop, but could work with another looping statement like ‘for’.

#!/bin/bash

while read line
do
echo $line
done < datafile.csv

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post