From owner-freebsd-questions Fri Jun 25 8: 7:52 1999 Delivered-To: freebsd-questions@freebsd.org Received: from ns.clientlogic.com (ns.clientlogic.com [207.51.66.75]) by hub.freebsd.org (Postfix) with ESMTP id 73530157B8 for ; Fri, 25 Jun 1999 08:07:39 -0700 (PDT) (envelope-from ChrisMic@clientlogic.com) Received: by site0s1 with Internet Mail Service (5.5.2448.0) id ; Fri, 25 Jun 1999 11:07:38 -0400 Message-ID: <6C37EE640B78D2118D2F00A0C90FCB44011059EA@site2s1> From: Christopher Michaels To: 'Lowell Gilbert' Cc: "FreeBSD Questions (E-mail)" Subject: RE: Cycling bootup splash screens? (trivial) Date: Fri, 25 Jun 1999 11:09:35 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks for the info. In all honesty, it's a novelty, since it's new to me and I have here a machine that will be rebooted frequently. The "novelty" will probably wear off by next week. MY freebsd machine, which is my network server, has no monitor attached and it only rebooted when I put in a new kernel. That, and the thought just made me curious of how I would go about making it cycle (or randomize). I could then apply that knowledge to other things. Thanks again, Chris > -----Original Message----- > From: Lowell Gilbert [SMTP:lowell@world.std.com] > Sent: Thursday, June 24, 1999 5:26 PM > To: ChrisMic@clientlogic.com > Cc: questions@FreeBSD.org > Subject: Re: Cycling bootup splash screens? (trivial) > > From: Christopher Michaels > Date: Thu, 24 Jun 1999 16:49:29 -0400 > > I was thinking the latter, of using a symlink to an image and just > leaving > /boot/loader.conf alone. > > That seems easiest (and best) to me. > > Unfortunately, i'm not versed enough to get started on that script. > I'll > probably beat my head over it this weekend. :^) > > It'll be good practice. > > You wouldn't happen to have any ideas on how I would go about randomly > selecting a file in a directory would you? > > Well, that is the hard part, isn't it? Once you've got a filename in > a (shell script) variable, making a symbolic link to it in a specific > place is easy. > > In my shell, bash, you have a variable that gives you random values, > indexable arrays, and arithmetic calculations. That is enough to > randomly pick one of a set. You can get the set from 'ls', and you > can get the number of items in the set from applying 'wc' to 'ls'. > > As a C programmer, I only thought about the shell stuff for a few > seconds before realizing that a program to randomly pick one of its > parameters (and spit it back) is essentially a two-liner: > #include > int main(int argc, char *argv[]) > { > srandomdev(); > printf("%s",argv[random()%argc]); > } > which could make the shell script even easier. > > Actually, I assumed that you'd want to cycle through the screens > rather than picking one randomly. But then, I don't "get" the > attraction of splash screens, myself. > > Good luck. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message