xref: /illumos-gate/usr/src/man/man1/sortbib.1 (revision 5422785d352a2bb398daceab3d1898a8aa64d006)
te
Copyright (c) 1992, Sun Microsystems, Inc.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
SORTBIB 1 "Sep 14, 1992"
NAME
sortbib - sort a bibliographic database
SYNOPSIS

sortbib [-s KEYS] database...
DESCRIPTION

sortbib sorts files of records containing refer key-letters by user-specified keys. Records may be separated by blank lines, or by `.[' and `.]' delimiters, but the two styles may not be mixed together. This program reads through each database 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 sortbib may not be used in a pipeline to read standard input.

The most common key-letters and their meanings are given below. %A

Author's name

%B

Book containing article referenced

%C

City (place of publication)

%D

Date of publication

%E

Editor of book containing article referenced

%F

Footnote number or label (supplied by refer)

%G

Government order number

%H

Header commentary, printed before reference

%I

Issuer (publisher)

%J

Journal containing article

%K

Keywords to use in locating reference

%L

Label field used by -k option of refer

%M

Bell Labs Memorandum (undefined)

%N

Number within volume

%O

Other commentary, printed at end of reference

%P

Page number(s)

%Q

Corporate or Foreign Author (unreversed)

%R

Report, paper, or thesis (unpublished)

%S

Series title

%T

Title of article or book

%V

Volume number

%X

Abstract \(em used by roffbib, not by refer

%Y,Z

Ignored by refer

By default, sortbib alphabetizes by the first %A and the %D fields, which contain the senior author and date.

sortbib sorts on the last word on the %A line, which is assumed to be the author's last name. A word in the final position, such as `jr.' or `ed.', 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 nroff convention `\e0' in place of a blank. A %Q field is considered to be the same as %A, except sorting begins with the first, not the last, word. sortbib sorts on the last word of the %D line, usually the year. It also ignores leading articles (like `A' or `The') when sorting by titles in the %T or %J fields; it will ignore articles of any modern European language. If a sort-significant field is absent from a record, sortbib places that record before other records containing that field.

No more than 16 databases may be sorted together at one time. Records longer than 4096 characters will be truncated.

OPTIONS
-sKEYS

Specify new KEYS. For instance, -sATD will sort by author, title, and date, while -sA+D will sort by all authors, and date. Sort keys past the fourth are not meaningful.

SEE ALSO

addbib(1), indxbib(1), lookbib(1), refer(1), roffbib(1), attributes(5)

BUGS

Records with missing author fields should probably be sorted by title.