bug-textutils
[Top][All Lists]
Advanced

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

Problems with "tr -s"


From: Davis, Ricardo C.
Subject: Problems with "tr -s"
Date: Fri, 22 Feb 2002 17:27:04 -0500

Hi,

I'm using GNU textutils 2.0e on a RedHat Linux 6.2 box.  I've written a bash script to create a password based on the following criteria:  certain characters excluded, at least 10 characters long, and no repeated characters (see below).  I'm using mkpasswd to create the test password and "tr" to remove the unwanted and duplicate characters.

When I run this script, it appears that none of the duplicate characters are removed.  I added the last line to double-check by attempting to remove the duplicates -- without success.  Is this a known bug?  Thanks for your help with this issue.


-Ricardo
______________________________________________________
Ricardo Davis
Intermedia Communications - Advanced Building Networks

_______________________________________________________________________

#!/bin/bash
# suggestpw -- suggest a pretty good password
echo -n "Generating password "
pwlen=0
until [ $pwlen -ge 11 ]
do
   newpw=`mkpasswd -2 -l 10 -d 3 -C 3 | tr -ds 'l1O08B' '[:alnum:]'`
   pwlen=`echo $newpw | wc -c`
   echo -n "."
#   echo -n $pwlen
#   break
done
echo; echo $newpw
echo "$newpw" | tr -s '[:alnum:]'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]