Skip to content

randstr.1

Manvendra Bhangui edited this page Feb 25, 2024 · 4 revisions

NAME

randstr - fetch a random text string from a specified file

SYNOPIS

**randstr **filename filename.dat

DESCRIPTION

In essence, randstr is a stripped-down, minimalist version of the popular fortune(1) program.

It reads files with the same structure as the fortunes databases, and displays a random string.

Usage

randstr might be used, with a database of signatures created with a text editor and the strfile(8) and unstr(8) utilities, to randomly change the $HOME/.signature file. To do so, create the necessary database as, for example, signatures and signatures.dat in the home directory, and add the following line to .profile or .login:

**randstr signatures >.signature

As superuser, a similar sort of thing could be placed in the Pnews(1) or Rnmail(1) scripts, although it should certainly test to be certain that the files exist, and creating the files of signatures might require a good deal of help for a lot of users.

Also as superuser, one might use randstr with a shell or Perl script to read the etc/passwd database and create a strfile type database, and use this database to run a monthly lottery.

BUGS

None known.

SEE ALSO

fortune(1), strfile(1),

Clone this wiki locally