File: randpass.awk

package info (click to toggle)
bacula 15.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,780 kB
  • sloc: ansic: 194,276; cpp: 41,177; sh: 28,258; python: 6,669; makefile: 5,275; perl: 3,666; sql: 1,371; java: 345; xml: 196; awk: 51; sed: 25
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" }