X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER X-Spam-Check-By: sourceware.org Message-Id: <7b4dai$em8g8@dmzms99901.na.baesystems.com> X-SENDER-IP: 10.37.193.65 X-SENDER-REPUTATION: None X-SENDER-IP: 10.40.167.5 X-SENDER-REPUTATION: None content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Finding either boot time or login time Date: Mon, 2 Feb 2009 11:54:15 -0500 From: "Cooper, Karl \(US SSA\)" To: "Jerry D. Hedden" , X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com > Mark J. Reed writes: >> One-liner to display the boot time: >> $ perl -lane 'print ~~localtime(time-$F[0])' /proc/uptime >=20 > Ronald Fischer wrote: >> Would you mind explaining the ~~ trick? >=20 > Clever tricks are interesting, but definitely are an obfuscation. > This makes things more plain: >=20 > perl -lane 'print(scalar(localtime(time() - int($F[0]))))' > /proc/uptime=20 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/