1829748 Members
4015 Online
109992 Solutions
New Discussion

Reading from a file

 
SOLVED
Go to solution
System Dude_1
Frequent Advisor

Reading from a file

Dear Friend,

How could i run a for i command to read from a file that has a list of date example :

xyz file contain :
1234
4567
8999

for i in xyz
do
echo $i
done

I want it to have an ouput as sequentially
1234
4567
8999
Performance Issue on HP-UX 10.20
3 REPLIES 3
H.Merijn Brand (procura
Honored Contributor

Re: Reading from a file

for i in `sort -n xyz` ; do
echo $i
done
Enjoy, Have FUN! H.Merijn
RAC_1
Honored Contributor

Re: Reading from a file

Very easy

for i in `sort -n xyz` ; do
echo $i
done

Regards,
There is no substitute to HARDWORK
Darren Prior
Honored Contributor
Solution

Re: Reading from a file

Hi,

If you're wanting to read each line from the file and then do something with it:

while read i
do
echo $i
done
regards,

Darren.
Calm down. It's only ones and zeros...