Using the entire line with space in between

Hi Folks,

I have a report data like the one seen below.

FRUITS@NEW_ORANGE(1500 04/29)
FRUITS@NEW_ORANGE(1500 05/04)
FRUITS@NEW_ORANGE(1500 05/05)
FRUITS@NEW_ORANGE(1500 05/07)
FRUITS@NEW_ORANGE(1500 05/12)

I need to use each of this lines separately in another for loop like the one shown below.

for i in `cat fruit.txt`
do
echo $1
done

The output of this script comes like

FRUITS@NEW_ORANGE(1500
04/29)
FRUITS@NEW_ORANGE(1500
05/04)
FRUITS@NEW_ORANGE(1500
05/05)
FRUITS@NEW_ORANGE(1500
05/07)
FRUITS@NEW_ORANGE(1500
05/12)

But i need the output like

FRUITS@NEW_ORANGE(1500 04/29)
FRUITS@NEW_ORANGE(1500 05/04)
FRUITS@NEW_ORANGE(1500 05/05)
FRUITS@NEW_ORANGE(1500 05/07)
FRUITS@NEW_ORANGE(1500 05/12)

can someone help?

Thanks

while read i
do
echo "$i"
done < fruit.txt

ALWAYS use this form of loop to read data from file.

That worked :slight_smile: :slight_smile: :slight_smile:

Thanks much !!!