Code:
while read line
do
echo $line `date` >>b.txt
done <a.txt
Notes.
If the input file is large enough, or the machine is slow enough, the value of the date may change.
If you want the date to be the same throughout the run:
Code:
date=`date`
while read line
do
echo $line $date >>b.txt
done <a.txt
If you want to erase b.txt for each run, add
at the beginning.