'\" te .\" Copyright (c) 1992, Sun Microsystems, Inc. .TH sortbib 1 "14 Sep 1992" "SunOS 5.11" "User Commands" .SH NAME sortbib \- sort a bibliographic database .SH SYNOPSIS .LP .nf \fBsortbib\fR [\fB-s\fR \fIKEYS\fR] \fIdatabase\fR... .fi .SH DESCRIPTION .sp .LP \fBsortbib\fR sorts files of records containing \fBrefer\fR key-letters by user-specified keys. Records may be separated by blank lines, or by `\fB\&.[\fR' and `\fB\&.]\fR' delimiters, but the two styles may not be mixed together. This program reads through each \fIdatabase\fR and pulls out key fields, which are sorted separately. The sorted key fields contain the file pointer, byte offset, and length of corresponding records. These records are delivered using disk seeks and reads, so \fBsortbib\fR may not be used in a pipeline to read standard input. .sp .LP The most common key-letters and their meanings are given below. .sp .ne 2 .mk .na \fB\fB%A\fR\fR .ad .RS 8n .rt Author's name .RE .sp .ne 2 .mk .na \fB\fB%B\fR\fR .ad .RS 8n .rt Book containing article referenced .RE .sp .ne 2 .mk .na \fB\fB%C\fR\fR .ad .RS 8n .rt City (place of publication) .RE .sp .ne 2 .mk .na \fB\fB%D\fR\fR .ad .RS 8n .rt Date of publication .RE .sp .ne 2 .mk .na \fB\fB%E\fR\fR .ad .RS 8n .rt Editor of book containing article referenced .RE .sp .ne 2 .mk .na \fB\fB%F\fR\fR .ad .RS 8n .rt Footnote number or label (supplied by \fBrefer\fR) .RE .sp .ne 2 .mk .na \fB\fB%G\fR\fR .ad .RS 8n .rt Government order number .RE .sp .ne 2 .mk .na \fB\fB%H\fR\fR .ad .RS 8n .rt Header commentary, printed before reference .RE .sp .ne 2 .mk .na \fB\fB%I\fR\fR .ad .RS 8n .rt Issuer (publisher) .RE .sp .ne 2 .mk .na \fB\fB%J\fR\fR .ad .RS 8n .rt Journal containing article .RE .sp .ne 2 .mk .na \fB\fB%K\fR\fR .ad .RS 8n .rt Keywords to use in locating reference .RE .sp .ne 2 .mk .na \fB\fB%L\fR\fR .ad .RS 8n .rt Label field used by \fB-k\fR option of \fBrefer\fR .RE .sp .ne 2 .mk .na \fB\fB%M\fR\fR .ad .RS 8n .rt Bell Labs Memorandum (undefined) .RE .sp .ne 2 .mk .na \fB\fB%N\fR\fR .ad .RS 8n .rt Number within volume .RE .sp .ne 2 .mk .na \fB\fB%O\fR\fR .ad .RS 8n .rt Other commentary, printed at end of reference .RE .sp .ne 2 .mk .na \fB\fB%P\fR\fR .ad .RS 8n .rt Page number(s) .RE .sp .ne 2 .mk .na \fB\fB%Q\fR\fR .ad .RS 8n .rt Corporate or Foreign Author (unreversed) .RE .sp .ne 2 .mk .na \fB\fB%R\fR\fR .ad .RS 8n .rt Report, paper, or thesis (unpublished) .RE .sp .ne 2 .mk .na \fB\fB%S\fR\fR .ad .RS 8n .rt Series title .RE .sp .ne 2 .mk .na \fB\fB%T\fR\fR .ad .RS 8n .rt Title of article or book .RE .sp .ne 2 .mk .na \fB\fB%V\fR\fR .ad .RS 8n .rt Volume number .RE .sp .ne 2 .mk .na \fB\fB%X\fR\fR .ad .RS 8n .rt Abstract \(em used by \fBroffbib\fR, not by \fBrefer\fR .RE .sp .ne 2 .mk .na \fB\fB%Y,Z\fR\fR .ad .RS 8n .rt Ignored by \fBrefer\fR .RE .sp .LP By default, \fBsortbib\fR alphabetizes by the first \fB%A\fR and the \fB%D\fR fields, which contain the senior author and date. .sp .LP \fBsortbib\fR sorts on the last word on the \fB%A\fR line, which is assumed to be the author's last name. A word in the final position, such as `\fBjr.\fR' or `\fBed.\fR', will be ignored if the name beforehand ends with a comma. Authors with two-word last names or unusual constructions can be sorted correctly by using the \fBnroff\fR convention `\fB\e0\fR\&' in place of a blank. A \fB%Q\fR field is considered to be the same as \fB%A\fR, except sorting begins with the first, not the last, word. \fBsortbib\fR sorts on the last word of the \fB%D\fR line, usually the year. It also ignores leading articles (like `\fBA\fR' or `\fBThe\fR') when sorting by titles in the \fB%T\fR or \fB%J\fR fields; it will ignore articles of any modern European language. If a sort-significant field is absent from a record, \fBsortbib\fR places that record before other records containing that field. .sp .LP No more than 16 databases may be sorted together at one time. Records longer than 4096 characters will be truncated. .SH OPTIONS .sp .ne 2 .mk .na \fB\fB-s\fR\fIKEYS\fR\fR .ad .RS 10n .rt Specify new \fIKEYS\fR. For instance, \fB-sATD\fR will sort by author, title, and date, while \fB-sA+D\fR will sort by all authors, and date. Sort keys past the fourth are not meaningful. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitytext/doctools .TE .SH SEE ALSO .sp .LP \fBaddbib\fR(1), \fBindxbib\fR(1), \fBlookbib\fR(1), \fBrefer\fR(1), \fBroffbib\fR(1), \fBattributes\fR(5) .SH BUGS .sp .LP Records with missing author fields should probably be sorted by title.