ipt_recent Time Format

Gregory D Hough mr6re9-mI4xJ4qlgtBiLUuM0BA3LQ at public.gmane.org
Mon Aug 14 00:38:20 UTC 2006


Gregory D Hough wrote:
> 
> How do I use date or time or whatever to read in the current value of 
> NOW in this format?
> 
In the spirit of archived circumlocutions...

info coreutils date
First, a quote:

      Our units of temporal measurement, from seconds on up to months,
      are so complicated, asymmetrical and disjunctive so as to make
      coherent mental reckoning in time all but impossible.  Indeed, had
      some tyrannical god contrived to enslave our minds to time, to
      make it all but impossible for us to escape subjection to sodden
      routines and unpleasant surprises, he could hardly have done
      better than handing down our present system.  It is like a set of
      trapezoidal building blocks, with no vertical or horizontal
      surfaces, like a language in which the simplest thought demands
      ornate constructions, useless particles and lengthy
      circumlocutions.  Unlike the more successful patterns of language
      and science, which enable us to face experience boldly or at least
      level-headedly, our system of temporal calculation silently and
      persistently encourages our terror of time.

...  It is as though architects had to measure length in feet,
      width in meters and height in ells; as though basic instruction
      manuals demanded a knowledge of five different languages.  It is
      no wonder then that we often look into our own immediate past or
      future, last Tuesday or a week from Sunday, with feelings of
      helpless confusion.  ...

      -- Robert Grudin, `Time and the Art of Living'.

Google hasn't been my friend yet either so my workaround is as follows:

#!/bin/bash
# Get current timestamp in mystical ipt_recent format
# Create a bogus entry
echo 11.11.11.11 > /proc/net/ipt_recent/GZ
# Read time from bogus entry
cat /proc/net/ipt_recent/GZ | grep '11\.11\.11\.11' | cut -b 35-44 > NOW
# Display timestamp (or reuse the value)
cat NOW
# Remove bogus entry
echo -11.11.11.11 > /proc/net/ipt_recent/GZ

[root at localhost ~]# sh TIMER
2897398043

Thanks anyhow,
greg
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list