|
Fyllo Theos Newbie
Joined: 11 Apr 2005 Posts: 1
|
Posted: Mon Apr 11, 2005 8:53 pm
Help with exec command |
I am making an alias to create a random password using all alpha and numeric values. The password is between 5 and 8 characters long, this is what I have so far:
The list of alpha and numeric characters:
#VAR list_alphadigit {a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|1|2|3|4|5|6|7|8|9|0}
The alias to create a random digit from the above list:
#ALIAS random_character {%item( @list_alphadigit, %random( 1, %numitems( @list_alphadigit)))}
The alias to create a new password:
#ALIAS create_password {#VAR new_password {%repeat( %exec( random_character), %random( 5, 8))}}
The problem with what I currently have is that the %repeat command will only repeat the value of the random_character alias. This causes me to get values such as "aaaaa" and "4444444". I cannot seem to figure out how to make it execute the alias 'random_character' each time it repeats it, instead of just repeating the same value.
Any ideas or suggestions? |
|
|
|
Kiasyn Apprentice
Joined: 05 Dec 2004 Posts: 196 Location: New Zealand
|
Posted: Mon Apr 11, 2005 9:10 pm |
#ALIAS create_password {new_password = "";#loop %random(5,8) {new_password = %concat(@new_password,%random(1,%numitems(@list_alphadight)))}}
didnt test this i hope it helps |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Mon Apr 11, 2005 10:21 pm |
Couple of fixes
#ALIAS create_password {new_password = "";#loop %random(5,8) {new_password = %concat(@new_password,%item(@list_alphadigit,%random(1,%numitems(@list_alphadigit))))}} |
|
|
|
|
|