File: randpass.awk

package info (click to toggle)
bacula 5.0.2-2.2%2Bsqueeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 22,692 kB
  • ctags: 15,071
  • sloc: ansic: 109,509; cpp: 24,105; sh: 21,958; makefile: 4,012; perl: 3,083; sql: 1,366; lisp: 479; python: 166; xml: 64; sed: 32; awk: 8
file content (14 lines) | stat: -rw-r--r-- 405 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

#   Dumb little AWK program to convert random decimal
#   values generated by rand.bc into passwords from the
#   character set defined below as "charset".

BEGIN {
    charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
    for (i = 0; i < length(charset); i++) {
    	set[i] = substr(charset, i, 1)
    }
}
    { printf "%s", set[$1 % length(charset)] }
    
END { printf "\n" }