Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Print last line in a file

by perigeeV (Hermit)
on Aug 22, 2001 at 05:39 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-03-28 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found