Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Print last line in a file

by perigeeV (Hermit)
on Aug 22, 2001 at 05:39 UTC ( #106857=note: print w/replies, xml ) Need Help??


in reply to Print last line in a file

I've always done it as one-liner:

perl -ne '$last=$_; END{print $last}'

Similar in spirit to tachyon's reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://106857]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2022-12-08 22:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?