in reply to Variable still not holding contents
jdporter and the others have showed you what was giving unexpected results on every run. There is one more error that will occasionally give you problems, perhaps without your ever knowing it.
You have a 'race condition' on your savedpasswords.txt file. That means that two instances (call tham A and B) of your script running at the same time can give you a corrupt save file. If the sequence
By opening to append rather than truncate when you write, you avoided the much more serious error of B's result being not recorded after the above sequence. In either case the probability of error is small, but it is a structural problem that can do you serious injury in other circumstances. The worst that can happen here is that two users have the same hashed passwd, with mischief available to the first one to notice.
To fix the problem, open the file only once, in '+>>' mode, and do not close it again until you have written the new password.
I'd like to second virtualsue's more general advice, it is the best way I know to get comfortable with a language.
After Compline,
Zaxo
|
|---|