Showing posts with label each line. Show all posts
Showing posts with label each line. Show all posts

Thursday, October 11, 2007

read and display each line of a file

1. command line
while read line ;do echo $line ;done < /etc/hosts

2. script
[db2inst1@vapp1-1 resetocbc]$ more /tmp/i.sh
while read line
do
echo $line
done < /etc/hosts