X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: <4982FB77 DOT 7020505 AT byu DOT net> <5 DOT 2 DOT 0 DOT 9 DOT 1 DOT 20090130164221 DOT 01ec8dd0 AT localhost> Date: Mon, 2 Feb 2009 09:34:06 -0500 Message-ID: <1ff86f510902020634g49262880s20929642e46a9a33@mail.gmail.com> Subject: Re: Finding either boot time or login time From: "Jerry D. Hedden" To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 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/