1*48503Scael.\" Copyright (c) 1983, 1990, 1991 Regents of the University of California. 243738Scael.\" All rights reserved. 319755Smckusick.\" 443738Scael.\" %sccs.include.redist.man% 519755Smckusick.\" 6*48503Scael.\" @(#)sortbib.1 6.3 (Berkeley) 04/22/91 743738Scael.\" 8*48503Scael.Dd 9*48503Scael.Dt SORTBIB 1 10*48503Scael.Os BSD 4.2 11*48503Scael.Sh NAME 12*48503Scael.Nm sortbib 13*48503Scael.Nd sort bibliographic database 14*48503Scael.Sh SYNOPSIS 15*48503Scael.Nm sortbib 16*48503Scael.Op Fl s Ar KEYS 17*48503Scael.Ar database Ar ... 18*48503Scael.Sh DESCRIPTION 19*48503Scael.Nm Sortbib 2019755Smckusicksorts files of records containing 21*48503Scael.Xr refer 2219755Smckusickkey-letters by user-specified keys. 2319755SmckusickRecords may be separated by blank lines, 24*48503Scaelor by 25*48503Scael.Ql \&.[ 26*48503Scaeland 27*48503Scael.Ql \&.] 28*48503Scaeldelimiters, 2919755Smckusickbut the two styles may not be mixed together. 3019755SmckusickThis program reads through each 31*48503Scael.Ar database 3219755Smckusickand pulls out key fields, which are sorted separately. 3319755SmckusickThe sorted key fields contain the file pointer, 3419755Smckusickbyte offset, and length of corresponding records. 3519755SmckusickThese records are delivered using disk seeks and reads, so 36*48503Scael.Nm sortbib 3719755Smckusickmay not be used in a pipeline to read standard input. 38*48503Scael.Pp 39*48503ScaelOption available: 40*48503Scael.Bl -tag -width 4n 41*48503Scael.It s 4219755SmckusickBy default, 43*48503Scael.Nm sortbib 4419755Smckusickalphabetizes by the first %A and the %D fields, 4519755Smckusickwhich contain the senior author and date. 4619755SmckusickThe 47*48503Scael.Fl s 4819755Smckusickoption is used to specify new 49*48503Scael.Ar KEYS . 5019755SmckusickFor instance, 51*48503Scael.Fl s Ns Ar ATD 5219755Smckusickwill sort by author, title, and date, 5319755Smckusickwhile 54*48503Scael.Fl s Ns Ar A+D 5519755Smckusickwill sort by all authors, and date. 5619755SmckusickSort keys past the fourth are not meaningful. 57*48503Scael.El 58*48503Scael.Pp 5919755SmckusickNo more than 16 databases may be sorted together at one time. 6019755SmckusickRecords longer than 4096 characters will be truncated. 61*48503Scael.Pp 62*48503Scael.Nm Sortbib 6319755Smckusicksorts on the last word on the %A line, 6419755Smckusickwhich is assumed to be the author's last name. 6519755SmckusickA word in the final position, such as ``jr.'' or ``ed.'', 6619755Smckusickwill be ignored if the name beforehand ends with a comma. 6719755SmckusickAuthors with two-word last names or unusual constructions 6819755Smckusickcan be sorted correctly by using the 69*48503Scael.Xr nroff 7019755Smckusickconvention ``\e0'' in place of a blank. 7119755SmckusickA %Q field is considered to be the same as %A, 7219755Smckusickexcept sorting begins with the first, not the last, word. 73*48503Scael.Nm Sortbib 7419755Smckusicksorts on the last word of the %D line, usually the year. 7519755SmckusickIt also ignores leading articles (like ``A'' or ``The'') 7619755Smckusickwhen sorting by titles in the %T or %J fields; 7719755Smckusickit will ignore articles of any modern European language. 7819755SmckusickIf a sort-significant field is absent from a record, 79*48503Scael.Nm sortbib 8019755Smckusickplaces that record before other records containing that field. 81*48503Scael.Sh SEE ALSO 82*48503Scael.Xr refer 1 , 83*48503Scael.Xr addbib 1 , 84*48503Scael.Xr roffbib 1 , 85*48503Scael.Xr indxbib 1 , 86*48503Scael.Xr lookbib 1 87*48503Scael.Sh AUTHORS 8819755SmckusickGreg Shenaut, Bill Tuthill 89*48503Scael.Sh BUGS 9019755SmckusickRecords with missing author fields 9119755Smckusickshould probably be sorted by title. 92*48503Scael.Sh HISTORY 93*48503ScaelThe 94*48503Scael.Nm 95*48503Scaelcommand appeared in 96*48503Scael.Bx 4.2 . 97