how do we retrieve a line from a file in unix

we need to capture a record from a file in to a variable and do modifications to it .. so capturing line by line in a file in to some variable

Do you want to retrieve a line based on a pattern ?

grep "pattern" file

or do you want to read file line by line ?

while read line
do
      echo $line
done < file

hi .... anbu23

got muchwork done by ur info..

cheers :slight_smile: