From owner-freebsd-questions Thu Jun 24 14:25:47 1999 Delivered-To: freebsd-questions@freebsd.org Received: from europe.std.com (europe.std.com [199.172.62.20]) by hub.freebsd.org (Postfix) with ESMTP id 062BA152A6 for ; Thu, 24 Jun 1999 14:25:43 -0700 (PDT) (envelope-from lowell@world.std.com) Received: from world.std.com by europe.std.com (STD1.2/BZS-8-1.0) id RAA05193; Thu, 24 Jun 1999 17:25:43 -0400 (EDT) Received: by world.std.com (TheWorld/Spike-2.0) id AA20749; Thu, 24 Jun 1999 17:25:42 -0400 Date: Thu, 24 Jun 1999 17:25:42 -0400 Message-Id: <199906242125.AA20749@world.std.com> From: Lowell Gilbert To: ChrisMic@clientlogic.com Cc: questions@FreeBSD.org In-Reply-To: <6C37EE640B78D2118D2F00A0C90FCB44011059E5@site2s1> (message from Christopher Michaels on Thu, 24 Jun 1999 16:49:29 -0400) Subject: Re: Cycling bootup splash screens? (trivial) References: <6C37EE640B78D2118D2F00A0C90FCB44011059E5@site2s1> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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