--- /sys/man/1/join Mon Dec 3 00:42:12 2007 +++ /sys/man/1/join Tue Sep 24 00:45:14 2013 @@ -24,7 +24,7 @@ and .I file2 must be sorted in increasing -.SM ASCII +.SM UTF collating sequence on the fields on which they are to be joined, @@ -48,6 +48,8 @@ leading separators are discarded. .PP The following options are recognized, with POSIX syntax. +.TF "\fL-j\fIn m\fR " +.PD .TP .BI -a " n In addition to the normal output, @@ -80,7 +82,7 @@ .TP .BI -j "n m" Archaic equivalent for -.BI - n " m"\f1. +.BI - "n m\f1." .TP .BI -o fields Each output line comprises the designated fields. @@ -94,7 +96,6 @@ .I m is a field number. Archaic usage allows separate arguments for field designators. -.PP .TP .BI -t c Use character @@ -111,7 +112,7 @@ .B /adm/users file, leaving unknown birthdays empty. -The layout of +The layout of .B /adm/users is given in .IR users (6); @@ -120,18 +121,18 @@ .LR "ken:Feb\ 4,\ 1953" . .TP .L -tr : ' ' temp +awk -F: '$3 != ""' /adm/users | tr : ' ' | sort -k 3,3 >temp .br .ns .TP .L join -1 3 -2 3 -o 1.1,2.1 temp temp | awk '$1 < $2' -Print all pairs of users with identical userids. +Print all pairs of users with identical non-empty userids. .SH SOURCE .B /sys/src/cmd/join.c .SH "SEE ALSO" -.IR sort (1), -.IR comm (1), +.IR sort (1), +.IR comm (1), .IR awk (1) .SH BUGS With default field separation, --- /sys/src/9/teg2/usbehci.h Fri Mar 9 21:42:07 2012 +++ /sys/src/9/teg2/usbehci.h Mon Sep 23 23:08:54 2013 @@ -77,23 +77,6 @@ ulong insn[6]; /* implementation-specific */ }; -typedef struct Uhh Uhh; -struct Uhh { - ulong revision; /* ro */ - uchar _pad0[0x10-0x4]; - ulong sysconfig; - ulong sysstatus; /* ro */ - - uchar _pad1[0x40-0x18]; - ulong hostconfig; - ulong debug_csr; -}; - -enum { - /* hostconfig bits */ - P1ulpi_bypass = 1<<0, /* utmi if set; else ulpi */ -}; - extern Ecapio *ehcidebugcapio; extern int ehcidebugport; --- /sys/src/cmd/join.c Thu Sep 14 18:29:17 2006 +++ /sys/src/cmd/join.c Tue Sep 24 00:56:14 2013 @@ -3,11 +3,13 @@ #include #include #include + #define F1 0 #define F2 1 #define F0 3 #define NFLD 100 /* max field per line */ #define comp() runecmp(ppi[F1][j1],ppi[F2][j2]) + FILE *f[2]; Rune buf[2][BUFSIZ]; /*input lines */ Rune *ppi[2][NFLD+1]; /* pointers to fields in lines */ @@ -33,7 +35,6 @@ void seek1(void), seek2(void); Rune *strtorune(Rune *, char *); - void main(int argc, char **argv) { @@ -139,30 +140,47 @@ error("some input line was truncated", ""); exits(""); } -int runecmp(Rune *a, Rune *b){ - while(*a==*b){ - if(*a=='\0') return 0; + +int +runecmp(Rune *a, Rune *b) +{ + while(*a == *b) { + if(*a == '\0') + return 0; a++; b++; } - if(*a<*b) return -1; + if(*a < *b) + return -1; return 1; } -char *runetostr(char *buf, Rune *r){ + +char * +runetostr(char *buf, Rune *r) +{ char *s; - for(s=buf;*r;r++) s+=runetochar(s, r); - *s='\0'; + + for(s = buf; *r; r++) + s += runetochar(s, r); + *s = '\0'; return buf; } -Rune *strtorune(Rune *buf, char *s){ + +Rune * +strtorune(Rune *buf, char *s) +{ Rune *r; - for(r=buf;*s;r++) s+=chartorune(r, s); - *r='\0'; + + for (r = buf; *s; r++) + s += chartorune(r, s); + *r = '\0'; return buf; } + /* lazy. there ought to be a clean way to combine seek1 & seek2 */ #define get1() n1=input(F1) #define get2() n2=input(F2) + void seek2() { @@ -253,7 +271,7 @@ int input(int n) /* get input line and split into fields */ { - register int i, c; + int i, c; Rune *bp; Rune **pp; char line[BUFSIZ]; @@ -358,7 +376,8 @@ olistf[no] = *s=='1'? F1: F2; olist[no] = atoi(s += 2); break; - } /* fall thru */ + } + /* fall thru */ default: error("invalid -o list", ""); }