#include #include void usage(void) { fprint(2, "usage: %s\n", argv0); exits("usage"); } char randchar(char *s) { return s[nrand(strlen(s))]; } void main(int argc, char **argv) { char name[12]; ARGBEGIN { default: usage(); } ARGEND if(argc > 0) usage(); srand(nsec()); name[0] = randchar("23456789"); name[1] = randchar("01"); name[2] = randchar(name[1] == '1' ? "23456789" : "123456789"); name[3] = '-'; name[4] = randchar("23456789"); name[5] = randchar("1234567890"); name[6] = randchar("1234567890"); name[7] = '-'; name[8] = randchar("1234567890"); name[9] = randchar("1234567890"); name[10] = randchar("1234567890"); name[11] = randchar("1234567890"); print("%.*s\n", nelem(name), name); exits(nil); }