From owner-freebsd-current@FreeBSD.ORG Fri Jun 23 19:07:01 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1DF3016A492 for ; Fri, 23 Jun 2006 19:07:01 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 92F3443D49 for ; Fri, 23 Jun 2006 19:07:00 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5E09F.dip.t-dialin.net [84.165.224.159]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k5NJ1MFj087987 for ; Fri, 23 Jun 2006 21:01:22 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from Magellan.Leidinger.net (Magellan.Leidinger.net [192.168.1.1]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k5NJ6xIj013118 for ; Fri, 23 Jun 2006 21:06:59 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Date: Fri, 23 Jun 2006 21:07:40 +0200 From: Alexander Leidinger To: current@freebsd.org Message-ID: <20060623210740.6fb370bd@Magellan.Leidinger.net> X-Mailer: Sylpheed-Claws 2.3.1 (GTK+ 2.8.19; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new Cc: Subject: The fortune(6) / random problem (again) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2006 19:07:01 -0000 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