Usage: grand [-switches] [length]
-a | include alphabetic characters |
-n | include numeric characters |
-s | include symbol characters |
-x | generate hexadecimal characters |
-g | generate a GUID |
-h | -? | print this help |
If no arguments are specified, '-an 8' is assumed, which will generate a random 8-character alphanumeric string.
You can use it to generate passwords:
$ grand -ans 10
Ppzx4w~fdU
or GUIDs:
$ grand -g
83010e18-8a3a-57b0-33f7-b3235c67ce6b
or whatever you like...
Build it by running make
in the grand
directory (substitute my example location with the one in which
you've placed the source):
$ cd ~/src/grand
$ make
cc -std=c99 -o grand grand.c
Of course, you'll need make, and a C99 compiler to do so. GCC works well. ;)
If you don't have make
, simply use the final line of the above output as your command:
$ cc -std=c99 -o grand grand.c
Install it by moving it to a directory in your PATH
. For example:
$ mv grand ~/bin
-
Switches can be combined. For example, '-ans' specifies alpha + numeric + symbols.
-
Any argument without a '-' character is assumed to be the output length.
-
If '-x' is specified, any other character types (-a,-n,-s) are ignored.
-
If '-g' is specified, all other arguments are ignored.
-
GUIDs are always printed in lower-case. Don't whine, convert it to upper-case if you wish.