//
// RandomPass.java
//

/** Generates a random 8-character password. */
public class RandomPass {

  private static final int PASS_LEN = 8;
  private static final char MIN_CHAR = '!';
  private static final char MAX_CHAR = '~';

  public static void main(String[] args) {
    int passLen = PASS_LEN;
    if (args.length > 0) {
      passLen = Integer.parseInt(args[0]);
    }
    StringBuffer sb = new StringBuffer(passLen + 2);
    int range = MAX_CHAR - MIN_CHAR + 1;
    for (int i=0; i<passLen; i++) {
      char c = (char) (range * Math.random() + MIN_CHAR);
      sb.append(c);
    }
    System.out.println(sb);
  }

}

@@ -303,31 +303,206 @@
     
-if (args.length %3E 0) %7B%0A
+boolean alphaNum = false;%0A    for (String arg : args) %7B%0A      if (arg.equals(%22-nosymbols%22)) %7B%0A        alphaNum = true;%0A      %7D%0A      else %7B%0A        // assume argument is password character length%0A  
     
@@ -537,14 +537,18 @@
 (arg
-s%5B0%5D);
+);%0A      %7D
 %0A   
@@ -652,36 +652,41 @@
     
-for (int i=0; i%3C
+int i = 0;%0A    while (i %3C 
 passLen
-; i++
 ) %7B%0A
@@ -743,16 +743,202 @@
 _CHAR);%0A
+      if (alphaNum) %7B%0A        boolean alpha = (c %3E= 'a' && c %3C= 'z') %7C%7C (c %3E= 'A' && c %3C= 'Z');%0A        boolean num = c %3E= '0' && c %3C= '9';%0A        if (!alpha && !num) continue;%0A      %7D%0A
       sb
@@ -949,16 +949,27 @@
 end(c);%0A
+      i++;%0A
     %7D%0A  

Add "-nosymbols" argument for generating alphanumeric passwords.