lkml.org 
[lkml]   [1999]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How can Emacs get a unique ID per Linux reboot?
Riley Williams wrote:

> > neither suffices for a unique ID per reboot. (I think btime is
> > broken whereas uptime is OK.)
>
> In that case, try the following variant thereof...
>
> > echo $[`TZ=UTC date +%s`-`cut -d . -f 1 < /proc/uptime`]

Of course, things aren't as simple as this, you will have to take care
of the race in the above construct. Try the command a few times, and
you'll see that you get varying results.

Johan Myréen
jem@iki.fi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.064 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site