Category: | Utility Scripts |
Author/Contact Info | Terrence Hamilton - ersatz@netspace.net.au |
Description: | This script will generate a 9 character random password, consisting of 3 uppercase characters, 3 lowercase characters & 3 numbers. |
#!/usr/bin/perl $uppercase = join '', $uppercase, A..Z; $lowercase = join '', $lowercase, a..z; $numbers = join '', $numbers, 0..9; for ($i = 0; $i < 3; $i++) { $tmp = join '', $tmp, substr $uppercase, int rand length $uppercase, + 1; $tmp = join '', $tmp, substr $lowercase, int rand length $lowercase, + 1; $tmp = join '', $tmp, substr $numbers, int rand length $numbers, 1; }; while (length $tmp) { $password = join '', $password, substr $tmp, int rand length $tmp, 1 +, ''; }; print "Password: $password\n"; |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Random Password Generator
by radiantmatrix (Parson) on Jul 05, 2005 at 14:04 UTC | |
Re: Random Password Generator
by ihb (Deacon) on Jul 03, 2005 at 00:35 UTC | |
Re: Random Password Generator
by sh1tn (Priest) on Jul 02, 2005 at 14:08 UTC | |
by eric256 (Parson) on Jul 06, 2005 at 14:40 UTC | |
Re: Random Password Generator
by Anonymous Monk on Jul 01, 2005 at 07:51 UTC | |
by merlyn (Sage) on Jul 01, 2005 at 14:08 UTC | |
by cosimo (Hermit) on Jul 01, 2005 at 15:42 UTC | |
by adrianh (Chancellor) on Jul 02, 2005 at 00:24 UTC | |
by satz (Initiate) on Jul 02, 2005 at 04:22 UTC | |
by Anonymous Monk on Jul 03, 2005 at 19:05 UTC |