#!/usr/bin/awk -f BEGIN { srand(); a = rand()+rand()+rand(); } BEGIN { STR = "abcdefghijklmnopqrstuvwxyz" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "01234567890" L = length(STR) } BEGIN { for( i=1; i<=8; i++ ) { while(1) { ch[i] = substr(STR, int(L*rand()+0.5),1) if( ch[i] !~ /[0O1l]/ ) break; } } } BEGIN { USESIGNS = 1 if(USESIGNS) { STR = "+-*/=.?!$%#@" L = length(STR) IX = 2 +int(2*rand()+0.1) IY = IX+2+int(2*rand()+0.1) ch[IX] = substr(STR, int(L*rand()+0.5),1) ch[IY] = substr(STR, int(L*rand()+0.5),1) } } BEGIN { for( i=1; i<=8; i++ ) { printf("%s",ch[i]); } printf("\n"); }