8 last_val=${cur_password:0:1}
11 if [ $cur_password -ge $start_password ] && [ $cur_password -le $end_password ]; then
12 for (( a=1; a<${#cur_password}; a++ )); do
13 val=${cur_password:$a:1}
14 if [ $val -ge $last_val ]; then
15 if [ $val -eq $last_val ]; then
23 if [ $got_dupe -eq 1 ]; then
35 last_val=${cur_password:0:1}
39 if [ $cur_password -ge $start_password ] && [ $cur_password -le $end_password ]; then
40 for (( a=1; a<${#cur_password}; a++ )); do
41 val=${cur_password:$a:1}
42 if [ $val -ge $last_val ]; then
43 if [ $val -eq $last_val ]; then
44 dupe_count=$((dupe_count+1))
47 if [ $dupe_count -eq 2 ]; then
57 if [ $dupe_count -eq 2 ]; then
60 if [ $got_dupe -eq 1 ]; then
74 temp_password=$((password+1))
75 last_val=${temp_password:0:1}
76 new_password="$last_val"
77 for (( a=1; a<${#temp_password}; a++ )); do
78 val=${temp_password:$a:1}
79 if [ $val -lt $last_val ]; then
89 cur_password=$start_password
92 while [ $cur_password -le $end_password ]; do
93 echo -n "$cur_password: "
94 if ( check_valid_1 $cur_password ); then
96 valid_passwords=$((valid_passwords+1))
97 if ( check_valid_2 $cur_password ); then
99 valid_passwords_2=$((valid_passwords_2+1))
106 cur_password=$(get_next $cur_password)
109 echo "There are $valid_passwords valid passwords"
110 echo "And $valid_passwords_2 really valid passwords"