Reading from list file

Hi All,

I am spooling a list file from sql.

spool '$HOME/my.lst' ;
select a,b from table;
spool off;

Can anyone help me to read both the columns a and b on unix.

Regards,
Vikram

IFS=' '
while read a b
do
echo "a is $a"
echo "b is $b"
done < $HOME/my.lst

cheers,
Devaraj Takhellambam

Tx Dev,

but still my problem is not completely solved. As you had mentioned

IFS=' '
while read a b
do
echo "a is $a"
echo "b is $b"
done < $HOME/my.lst

I m able to get the output for b..but can you please further let me know what to do if I need to take the first 5 character from a and make it a directory name.

As I m very new for unix hope u understand my terminology.

Regards,
Vikram

Use cut command.

IFS=' '
while read a b
do
echo "a is $a"
dirname=`echo $a | cut -c 1-5`
echo $dirname
echo "b is $b"
done < $HOME/my.lst

cheers,
Devaraj Takhellambam

thanks, It works