Re: 822-date obsolete?
----- MAIN
You can't simply substitute 822-date with date -R, since date cares about
your LANG variable.
$ date -R
lör, 9 jan 1999 16:08:00 +0100
$ 822-date
Sat, 9 Jan 1999 16:09:31 +0100
$ LANG=C date -R
Sat, 9 Jan 1999 16:09:41 +0100
$
----- BTW
If you want to swap 822-date with something else, you don't need to hack
the /bin/date. You could provid a simle shell script or a function:
$ cat date.822
#!/bin/sh
LANG=C
date -R
$ date.822
Sat, 9 Jan 1999 16:15:14 +0100
$ zsdf() { LANG=C; date -R; }
$ zsdf
Sat, 9 Jan 1999 16:12:19 +0100
$
The first time around 822-date is slow, but then (depending whether it's
still im memory) is can't said be slow compared to the shell script but
yes it's slower than the raw /bin/date.
$ time date.822
Sat, 9 Jan 1999 16:16:27 +0100
real 0m0.079s
user 0m0.010s
sys 0m0.020s
$ time 822-date
Sat, 9 Jan 1999 16:16:35 +0100
real 0m0.072s
user 0m0.010s
sys 0m0.010s
$ time zsdf
Sat, 9 Jan 1999 16:19:44 +0100
real 0m0.008s
user 0m0.000s
sys 0m0.000s
$ time LANG=C date -R
Sat, 9 Jan 1999 16:20:51 +0100
real 0m0.008s
user 0m0.000s
sys 0m0.000s
$
-------------------------------------------------------------------------------
Karl Hammar Aspö Data karl@kalle.csb.ki.se
Lilla Aspö 2340 0173 140 57
S-742 94 Östhammar 070 511 97 84 Professionella Linuxlösningar
Sweden
-------------------------------------------------------------------------------
On Sat, 9 Jan 1999, Craig Sanders wrote:
> Package: dpkg-dev
> Version: 1.4.1
> Severity: wishlist
>
> i discovered today (while writing up a howto on doing virtual pop stuff
> with postfix) that the version of GNU date in potato (and probably
> slink) can output RFC-822 dates with the "-R" argument.
>
> 'date -R' is faster than '822-date' and doesn't require perl.
>
> my suggestion is to:
>
> a) hack /bin/date so that if argv[0] is '822-date' it runs 'date -R'
> b) replace 822-date with a symlink to /bin/date
>
> craig
>
> --
> craig sanders
>
>
> --
> To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
Reply to: