On Mon, 7 Oct 2002, Oliver Fromme wrote: > Peter Leftwich <[EMAIL PROTECTED]> wrote: > > On Sun, 6 Oct 2002, Fernando Gleiser wrote: > > > On Sun, 6 Oct 2002, Mikko Työläjärvi wrote: > > > > tr -cd a-zA-Z0-9 < /dev/urandom | dd bs=$len count=1 2>/dev/null > > It didn't work. My shell is tcsh so I tried: > > tr -cd a-zA-Z0-9 < /dev/urandom | dd bs=8 count=1 >& /dev/null > > And all I got was the next prompt.
> Yep, csh and tcsh suck pretty much. Not being able to separately > redirect stderr easily is one of the reasons. Bizarre. From now on I'll have to insert `bash ; ` before commands :) > In this particular case, you can use head instead of dd: > tr -cd a-zA-Z0-9 < /dev/urandom | head -c 8 Thanks for that! I was trying `cut -c` and didn't realize head had that flag. Now I can generate 8 characters: # tr -cd a-zA-Z0-9 < /dev/urandom | head -c 8 ; echo "" 0tXx3p3m ...and random phone numbers :) # tr -cd 0-9 < /dev/urandom | head -c 10 ; echo "" 5031594488 > If your intention is to generate passwords, then you should also include special >characters, not just letters and digits. I once wrote a small shell script to >generate good passwords: > http://www.secnetix.de/~olli/scripts/genpwd Nope. > After installing it somwhere in yout $PATH (for example in > /usr/local/bin) and making it executable, type "genpwd -h" Do any other flavors of unix come with password generators? > for usage information. It also uses /dev/urandom, if it > exists, but it also works fine without -- you can easily > remove that part from the script (three lines) and it will > still work with sufficient randomness, without having to > touch your kernel's entropy pool. Why is this an entropy pool and not an entropy ocean? Is there a way to cat /dev/dsp or analyze my soundcard's mic-in and sample randomness? > BTW, the script can also be (ab)used for other things. > There are two examples in the usage message. > Regards > Oliver > Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München > "All that we see or seem is just a dream within a dream" (E. A. Poe) Thanks again Oliver. -- Peter Leftwich President & Founder Video2Video Services Box 13692, La Jolla, CA, 92039 USA +1-413-403-9555 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message