in reply to RE: linux boot time
in thread linux boot time

Easier yet with sed and date:
date -d @$(sed -n '/^btime /s///p' /proc/stat)
(OK, there's no Perl here, but that was just for the thrill of "improving" upon a Randal L. Schwartz solution :)

Replies are listed 'Best First'.
Re^3: linux boot time
by merlyn (Sage) on Mar 26, 2012 at 19:47 UTC
    My "date" here doesn't have a "-d" that works that way. Nor is @$(...) standard. I suspect you're coding full of linuxisms without realizing it, although in this context, it's fair since it was about a "linux" boot time.

    -- Randal L. Schwartz, Perl hacker

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.