GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SHUFFLE (1)

NAME

shuffle - print a random permutation of the command line arguments

CONTENTS

Synopsis
Description
Examples
See Also
History
Authors
Bugs

SYNOPSIS

shuffle [-f filename ...] [-n number] [-p number] [arg] [...]

DESCRIPTION

The shuffle program prints a random permutation (or "shuffle") of its input lines. This can be useful in shell scripts for selecting a random order in which to do a set of tasks, view a set of files, etc.

If the -f option is given, the data is taken from that files’ contents or if the filename is - "stdin".

If the -n option is given, its argument is treated as a number, and the program prints a random permutation of the numbers greater than or equal to 0 and less than the argument.

If the -p option is given, its argument is treated as a number, and the program prints that number of randomly selected lines or arguments in a random order.

EXAMPLES

$ shuffle a b c d
c
b
d
a
$ shuffle -p 1 a b c d
d
$ shuffle -n 4 -p 2
0
3

SEE ALSO

jot(1)

HISTORY

The shuffle program first appeared in
.Nx 1.4 .

AUTHORS

Written by Perry E. Metzger (perry@piermont.com).

BUGS

The random number generator isn’t that great, and thus the permutations often aren’t that great.
Search for    or go to Top of page |  Section 1 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.