Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system command output 1

Status
Not open for further replies.

bluedragon2

IS-IT--Management
Jan 24, 2003
2,642
US
I have a line in my perl script that tails a file and the output is part of a web page being generated. The problem I am having is that the output is in a continous line.

The syntax is:

system "tail -20 /File.txt";

the output is:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

I need the output to be:

1
2
.
.
20

Any suggestions?

Thanks



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
@Out = `tail -20 /File.txt`;
foreach $Line (@Out) {
print "$Line";
}
 
Thanks, I had to add a \n in there, but it works great



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top