while in script

hi,

I need to run a script with a while command.
Basically, I need to select a few records and run something for each records until eof.

I have no idea on how to do it for uniX.

appreciate ur help
nisa

ENVIRON=`pwd`

find ${ENVIRON} -name ".ps" -user $user | while read psfile
do
���pdffile=`echo $psfile | sed s/.ps$//g`
���if [ -f ${pdffile}
.pdf ] ; then
������gzip -f ${pdffile}*.pdf
���fi
done

or you can try it like this:

cat datafile | while read line
do
���process $line
done

where process is the command you wish to run... or a subroutine or whatever.

I hope this helps