[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] YAGOLF: password generation



> This probably was requested before, but I'd
> like to see the shortest cmdline to generate
> a password of 8 random alphanumeric characters.
>
> The one I've got is 60 chars:
>
>     echo|perl -pe "@a=(A..Z,a..z,0..9);eval's##\$a[rand@a]#;'x8"

How about:

	echo ,,,,,,,,|perl -ple's/\W/chr rand(123)/gewhile/\W/'
	echo ,,,,,,,,|perl -pe's/\W/chr rand+123/gewhile/\W/'

The two solutions are 56 and 54 chars long respectively, but the second one 
causes a warning and has no newline at the end. There should be a way to do 
better I am sure.

Julien

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe