Sometimes the readline functionality is required and bash could tackle it.
Seems it needs redirect or pipe to provide data.

# !/bin/bash

# using pipe
cat txt | \
while read line
do
    echo $line
done

# using redirect
while read line
do
    echo $line
done < `cat txt`


Published

13 March 2014

Category

operation

Tags