oSoSo —> Random letters

Random letters

To create some random letters, use the following shell expression:

base64 -e /dev/urandom | tr -d '+/\r\n0-9' | head -c 500; echo

Explanation: base64 encodes the random bytes from /dev/urandom into lines of 72 chars, which only consist of letters, numbers, slashes and plus signs. tr eliminates all numbers, slashes, plus signs, linefeeds and carriage returns from the output of base64. head displays only the number of chars you specify (500 here). echo simply adds a linefeed for nicer output.

To get only capital letters add a-z to the tr string. This will delete all lower-case characters. To create lots of decimal numbers try '+/\r\na-zA-Z'. But there might be better scripts (e.g. rand at Shelldorado) for this ...

If you do not have base64, try using mimencode /dev/urandom instead. (mimencode is part of the metamail package.)

If you want to generate passwords you should consider using makepasswd (or APG for pronounceable passwords).

Felix Wiemann <Felix.Wiemann@ososo.de>