From owner-freebsd-questions Sat Oct 5 22:34:55 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B7BB137B401 for ; Sat, 5 Oct 2002 22:34:54 -0700 (PDT) Received: from smtp1.san.rr.com (smtp1.san.rr.com [24.25.195.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D46C43E6A for ; Sat, 5 Oct 2002 22:34:54 -0700 (PDT) (envelope-from Hostmaster@Video2Video.Com) Received: from 24-161-161-97.san.rr.com (24-161-161-97.san.rr.com [24.161.161.97]) by smtp1.san.rr.com (8.11.4/8.11.4) with ESMTP id g965Yoq23696 for ; Sat, 5 Oct 2002 22:34:51 -0700 (PDT) Date: Sat, 5 Oct 2002 22:35:28 -0700 (PDT) From: Peter Leftwich X-X-Sender: root@dhcp-407-32.san.rr.com To: FreeBSD Questions LIST Subject: /dev/urandom is randomly cool Message-ID: <20021005223308.D2062-100000@dhcp-407-32.san.rr.com> Organization: Video2Video Services - http://Www.Video2Video.Com MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I was sorting through my /usr/X11R6/bin/startx text-file and noticed: mcookie=`dd if=/dev/urandom bs=16 count=1 2>/dev/null | hexdump -e \\"%08x\\"` I started playing around with `cat /dev/urandom` and `head -1 /dev/urandom` so my question is... How can I use the head -1 method and change the output into just [A-Za-z0-9] and no spaces or punctuation? And specify length? -- Peter Leftwich President & Founder Video2Video Services Box 13692, La Jolla, CA, 92039 USA +1-413-403-9555 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message