Finding either boot time or login time

Jerry D. Hedden jdhedden@1979.usna.com
Mon Feb 2 14:34:00 GMT 2009


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/



More information about the Cygwin mailing list