for each password between first_possible and last_possible if (crypt(passwd) == encrypted_password) { print "Found it" exit }
However, don't confuse users by "protecting" them from UNIX; entries such as: alias dir ls -l alias rm rm -i are considered poor form.