Choosing random files from a sh script

Choosing random files from a sh script

Post by Tony Nuge » Tue, 20 Sep 1994 23:13:33



Is there any way to get a script to choose from several files on
a random basis?

I want to use this for two scripts that I have that "inject" a
signature into my email and posted messages. (If you want to see
these, email me).

After tweeking these scripts, I've got the email injector to work
fine now.  Although the news injector works, nn always emails my
replies and follows back to me saying that they failed (even though
they didn't! )-:   There's no "man inews" here, and "man nn" hardly
mentions this program.... more tweeking to be done here :)

So what I want to do is have a series of .sig files, say .sig.1,
.sig.2, .sig.3 and so on, then have these scripts to choose one
at random.

Any ideas?

(Many thanks in advance.)

Cheers
Tony
      __^__                                 .                        __^__
     ( ___ )--------------------------- _--_|\ ---------------------( ___ )
      | / |  Tony Nugent               /     *\ Griffith University  | \ |


     (_____)--------------------------------------------------------(_____)

 
 
 

Choosing random files from a sh script

Post by Barbara Vaugh » Wed, 21 Sep 1994 02:56:27


|> Is there any way to get a script to choose from several files on
|> a random basis?
|>
|> I want to use this for two scripts that I have that "inject" a
|> signature into my email and posted messages. (If you want to see
|> these, email me).
|>
|> After tweeking these scripts, I've got the email injector to work
|> fine now.  Although the news injector works, nn always emails my
|> replies and follows back to me saying that they failed (even though
|> they didn't! )-:   There's no "man inews" here, and "man nn" hardly
|> mentions this program.... more tweeking to be done here :)
|>
|> So what I want to do is have a series of .sig files, say .sig.1,
|> .sig.2, .sig.3 and so on, then have these scripts to choose one
|> at random.
|>
|> Any ideas?

You could parse out the last digit of the time of day or the result
of any other function that returns a fairly random, frequently-changing
numeric value.  Make sure you have a sig.0 file.

Barbara Vaughan

 
 
 

1. Choosing random files from a sh script

Is there any way to get a script to choose from several files on
a random basis?

I want to use this for two scripts that I have that "inject" a
signature into my email and posted messages. (If you want to see
these, email me).

After tweeking these scripts, I've got the email injector to work
fine now.  Although the news injector works, nn always emails my
replies and follows back to me saying that they failed (even though
they didn't! )-:   There's no "man inews" here, and "man nn" hardly
mentions this program.... more tweeking to be done here :)

So what I want to do is have a series of .sig files, say .sig.1,
.sig.2, .sig.3 and so on, then have these scripts to choose one
at random.

Any ideas?

(Many thanks in advance.)

Cheers
Tony
      __^__                                 .                        __^__
     ( ___ )--------------------------- _--_|\ ---------------------( ___ )
      | / |  Tony Nugent               /     *\ Griffith University  | \ |


     (_____)--------------------------------------------------------(_____)

2. Partitioning Zip drives

3. Execute a sh script under perl and sh: sh script; perl script?

4. Need Xconfig for Raven 1775 Monitor

5. Is "sh file" equivalent to "cat file | sh"

6. Will Sun release a patch for Solaris 10 / cron?

7. Help, cgi-bin script "random" will only return last url in random list.

8. Remote control DOS/Windows 3.1x/95/98/NT/OS2 WARP from UNIX!

9. ASCII 128-255 in sh script: sh strips bit 7!!!

10. make sh-script compatible between SUN-sh and bash

11. shell script for random files

12. I Need a Simple Random File Script!

13. choosing random words from a dictionary