Quote:
Originally Posted by Turran
Not correct. Check user AGN. Fully valid user.
If he tries to create an FTP account:
# python eabpostcount.py AGN
* Found more than one user: AGN
Why? There are other users that has the lettering agn in their name. All of them are valid
http://eab.abime.net/memberlist.php?...&ausername=AGN
That is because memberlist.php uses "like" instead of "=". Its not an exact match were getting.
|
Yes, but my previous Bourne shell example adds the functionality you want by testing the result/exit code (-ne 0 / != 0) of eab_post_count.py. Here's the example again.
Code:
#!/bin/sh
USER="Turran"
OUTPUT=`eab_post_count.py "$USER"`
RTN=$?
if test $RTN -ne 0 ; then
# user name not found or incomplete (more than one)
echo "User not found"
exit 1
fi
# we have a valid user name
# do your stuff here
echo "Post count: $OUTPUT"
Both incorrect and incomplete (more than one hit) user names will be rejected.
EDIT: I see what you mean now, finally, sorry for the misunderstanding. I will fix it.