This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Finding either boot time or login time
- From: "Jerry D. Hedden" <jdhedden at 1979 dot usna dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 2 Feb 2009 09:34:06 -0500
- Subject: Re: Finding either boot time or login time
- References: <loom.20090130T125737-221@post.gmane.org> <4982FB77.7020505@byu.net> <loom.20090130T152913-409@post.gmane.org> <5.2.0.9.1.20090130164221.01ec8dd0@localhost> <f60fe000901300757l23e6466bu4250f71c8593013d@mail.gmail.com> <loom.20090202T140523-18@post.gmane.org>
Mark J. Reed writes:
> One-liner to display the boot time:
> $ perl -lane 'print ~~localtime(time-$F[0])' /proc/uptime
Ronald Fischer wrote:
> Would you mind explaining the ~~ trick?
Clever tricks are interesting, but definitely are an obfuscation.
This makes things more plain:
perl -lane 'print(scalar(localtime(time() - int($F[0]))))' /proc/uptime
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/