The fortune(6) / random problem (again)
Alexander Leidinger
Alexander at Leidinger.net
Fri Jun 23 19:07:01 UTC 2006
Hi,
this was discussed a while ago (and I don't remember the ...
status-quo), but with a recent current I see non-random output of
fortune when using non standard files:
---snip---
while true; do
bin/fortune.sh
done
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
Leela: Hey, you know what might be a hoot?
Professor: No. Why would I know that?
^C%
---snip---
bin/fortune.sh contains:
---snip---
#!/bin/sh
/usr/games/fortune -se $(/bin/ls
-1 /usr/share/games/fortune/* /usr/local/share/games/fortune/*
| /usr/bin/grep -vE '(limerick|-o|.dat)$') 2>&1
---snip---
The files which are listed on the command line are:
---snip---
% /bin/ls
-1 /usr/share/games/fortune/* /usr/local/share/games/fortune/*
| /usr/bin/grep -vE
'(limerick|-o|.dat)$' /usr/local/share/games/fortune/futurama /usr/share/games/fortune/bofh-excuses /usr/share/games/fortune/calvin
/usr/share/games/fortune/chalkboard
/usr/share/games/fortune/discworld
/usr/share/games/fortune/excuses
/usr/share/games/fortune/fgump
/usr/share/games/fortune/fortunes
/usr/share/games/fortune/freebsd-tips
/usr/share/games/fortune/futurama
/usr/share/games/fortune/hitchhiker
/usr/share/games/fortune/homer
/usr/share/games/fortune/informatik
/usr/share/games/fortune/jargon
/usr/share/games/fortune/matrix
/usr/share/games/fortune/murphy
/usr/share/games/fortune/startrek
/usr/share/games/fortune/starwars
/usr/share/games/fortune/xfiles
/usr/share/games/fortune/zippy
---snip---
When not specifying a list of files ("fortune -se all"), I get a little
more random output. It's not very random in that it will very very
often print the "0" output:
---snip---
0
Numeric zero, as opposed to the letter `O' (the 15th
letter of the English alphabet). In their unmodified forms they
look a lot alike, and various kluges invented to make them visually
[...]
---snip---
And since this output is actually very long, it also does not fit the
"-s" specified on the command line.
When I do "while true; do; fortune -se /usr/share/games/fortune
/usr/local/share/games/fortune; done" I see more random output, but it
still contains long output and the "0"-quote still appears too often.
The "0"-quote comes from the "jargon" file, it's one of the large
files:
---snip---
% ll /usr/share/games/fortune/ | grep -v dat
total 5044
-r--r--r-- 1 root games 28K 5 Nov 2000 bofh-excuses
-r--r--r-- 1 root games 15K 17 Dez 2000 calvin
-r--r--r-- 1 root games 33K 4 Mai 2000 chalkboard
-rw-r--r-- 1 root wheel 56K 16 Sep 2001 discworld
-r--r--r-- 1 root games 20K 21 Feb 2000 excuses
-r--r--r-- 1 root games 2.7K 20 Jul 2000 fgump
-r--r--r-- 1 root wheel 2.1M 21 Jun 21:31 fortunes
-r--r--r-- 1 root wheel 79K 21 Jun 21:31 fortunes-o
-r--r--r-- 1 root wheel 612K 21 Jun 21:31 fortunes2-o
-r--r--r-- 1 root wheel 17K 21 Jun 21:31 freebsd-tips
-r--r--r-- 1 root games 40K 16 Sep 2001 futurama
-r--r--r-- 1 root wheel 25K 21 Jun 21:31 gerrold.limerick
-rw-r--r-- 1 root wheel 23K 16 Sep 2001 hitchhiker
-r--r--r-- 1 root games 51K 21 Apr 2000 homer
-r--r--r-- 1 root games 28K 29 Nov 2000 informatik
-r--r--r-- 1 root games 1.2M 8 Mai 2000 jargon
-r--r--r-- 1 root wheel 128K 21 Jun 21:31 limerick
-r--r--r-- 1 root games 35K 21 Apr 2000 matrix
-r--r--r-- 1 root wheel 62K 21 Jun 21:31 murphy
-r--r--r-- 1 root wheel 872B 21 Jun 21:31 murphy-o
-r--r--r-- 1 root wheel 27K 21 Jun 21:31 startrek
-r--r--r-- 1 root games 10K 20 Jul 2000 starwars
-r--r--r-- 1 root games 32K 20 Jul 2000 xfiles
-r--r--r-- 1 root wheel 38K 21 Jun 21:31 zippy
---snip---
Anyone up for fixing this?
Bye,
Alexander.
--
...and that is how we know the Earth to be banana-shaped.
http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137
More information about the freebsd-current
mailing list