X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.9 required=5.0 tests=BAYES_40,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Ronald Fischer Subject: Re: Finding either boot time or login time Date: Mon, 2 Feb 2009 14:11:11 +0000 (UTC) Lines: 16 Message-ID: References: <4982FB77 DOT 7020505 AT byu DOT net> <5 DOT 2 DOT 0 DOT 9 DOT 1 DOT 20090130164221 DOT 01ec8dd0 AT localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) 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 gmail.com> writes: > One-liner to display the boot time: > > $ perl -lane 'print ~~localtime(time-$F[0])' /proc/uptime Thanks a lot! This is great! Would you mind explaining the ~~ trick? localtime returns a list, so I would have concluded that applyiing ~ to this list would force it into scalar context, so it would bitwise negate the number of elements in the list. But this is obviously not done, because just by trying out your code, I see that it works. Ronald -- 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/