public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Cooper, Karl \(US SSA\)" <karl.cooper@baesystems.com>
To: "Jerry D. Hedden" <jdhedden@1979.usna.com>, 	<cygwin@cygwin.com>
Subject: RE: Finding either boot time or login time
Date: Mon, 02 Feb 2009 16:54:00 -0000	[thread overview]
Message-ID: <7b4dai$em8g8@dmzms99901.na.baesystems.com> (raw)

> 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 
I don't know perl, but I did try both of these one-liners on my
Cygwin 1.7 setup, and the output differs (by one second).  I thought
that was interesting.

--
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/

             reply	other threads:[~2009-02-02 16:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02 16:54 Cooper, Karl (US SSA) [this message]
2009-02-02 17:37 ` Owen Rees
  -- strict thread matches above, loose matches on Subject: below --
2009-01-30 15:33 Ronald Fischer
2009-01-30 15:58 ` Eric Blake
2009-01-30 15:58   ` Ronald Fischer
2009-01-30 16:43     ` Fabian Cenedese
2009-01-30 17:02       ` Mark J. Reed
2009-02-02 14:11         ` Ronald Fischer
2009-02-02 14:34           ` Jerry D. Hedden
2009-02-02 20:28             ` Mark J. Reed
2009-01-30 22:08     ` Brian Mathis
2009-01-30 22:45       ` Owen Rees

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='7b4dai$em8g8@dmzms99901.na.baesystems.com' \
    --to=karl.cooper@baesystems.com \
    --cc=cygwin@cygwin.com \
    --cc=jdhedden@1979.usna.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).