Path: utzoo!lsuc!ncrcan!brian From: brian@ncrcan.Toronto.NCR.COM (Brian Onn) Newsgroups: tor.news Subject: Re: Long message IDs (was Re: attcan't?) Message-ID: <1396@ncrcan.Toronto.NCR.COM> Date: 10 May 89 20:13:11 GMT References: <1394@ncrcan.Toronto.NCR.COM> <610787517.10071@ontmoh.UUCP> Reply-To: brian@ncrcan.Toronto.NCR.COM (Brian Onn) Organization: NCR Canada Ltd., Mississauga, Ontario Lines: 42 In article <1394@ncrcan.Toronto.NCR.COM>, I said: ... [ quoting Evan, who says:] >>This way, an article could be: <610566286.20194@foo.bar> > [This] may not be as easily generated from standard unix tools, though. > [The current C News IDs are shell scriptable using date and expr] > The new method (if adopted) would require a helper program. and then ... In article <610787517.10071@ontmoh.UUCP> peter@ontmoh.UUCP (Peter Renzland) writes: >You mean like this?: > > TZ=GMT0GMT export TZ > set -- `date "+ %y %j %H %M %S"` > EPOCHDATE=`expr $5 + 60 \* \( $4 + 60 \* \( $3 + 24 \* \( $2 - 1 + \( \( $1 - 69 \) / 4 \) + 365 \* \( $1 - 70 \) \) \) \)` > >That's how Shnews does it. > >-- >Peter Renzland @ Ontario Ministry of Health 416/964-9141 peter@ontmoh.UUCP Yeah, I mean like that. Ok, so it's possible to do this with date and expr too, using the perfect example of an expr contortion above :-) But this still may not be OK in a general purpose News distribution, as all implementations of date(1) do not support the format string concept. However, I will not be so narrow minded this time and say that it cannot be done in a shell script. Somebody could write an awk script to take the standard date format "Wed May 10 19:45:02 GMT 1989" and convert it into a 9 digit seconds string. So I conclude with a different position than I had taken previously, but honestly have forgotten why it was important to be able to do this in a shell script :-) Brian. -- +-------------------+--------------------------------------------------------+ | Brian Onn | UUCP:..!{uunet!attcan, watmath!utai}!lsuc!ncrcan!brian | | NCR Canada Ltd. | INTERNET: Brian.Onn@Toronto.NCR.COM | +-------------------+--------------------------------------------------------+