head	2.1;
access;
symbols
	fourth_edition:2.1;
locks
	grog:2.1; strict;
comment	@# @;


2.1
date	97.12.07.08.34.53;	author grog;	state Exp;
branches;
next	1.3;

1.3
date	97.11.24.00.16.22;	author grog;	state Exp;
branches;
next	1.2;

1.2
date	96.05.06.08.58.31;	author grog;	state Exp;
branches;
next	1.1;

1.1
date	96.04.06.12.30.52;	author grog;	state Exp;
branches;
next	;


desc
@Extract chapter numbers from list of chapters
@


2.1
log
@Base second edition
@
text
@#!/bin/sh
#
# Extract the Chapter number headings and titles from chapters and
# appendices, and create variables for the chapter number and title
#
# Greg Lehey, 6 April 1996
#
# $Id: getchapternumbers,v 1.3 1997/11/24 00:16:22 grog Exp grog $
#
# $Log: getchapternumbers,v $
# Revision 1.3  1997/11/24 00:16:22  grog
# Checkin 24 November, first stab at release version
#
# Revision 1.2  1996/05/06 08:58:31  grog
# Minor mods
#
# Revision 1.1  1996/04/06  12:30:52  grog
# Initial revision
#
length=$1
shift
echo .\\\" Chapters
echo .nr CN 0 1
cat $* | ../tools/stripcond $length | egrep '^\.Chapter' | sed 's:^.*\[n\(.*\)\] *"\(.*\)":.ds n\1 \\n+(CN\
.ds \1 Chapter \\\*\[n\1], \\fI\2\\fR:'
echo .\\\" Appendices
echo .nr AN 64 1
cat $* | ../tools/stripcond $length | egrep '^\.Appendix' | sed 's:^.*\[n\(.*\)\] *"\(.*\)":.ds n\1 \\N\'\'\\\\n+[AN]\''\
.ds \1 Appendix \\\*\[n\1], \\fI\2\\fR:'
@


1.3
log
@Checkin 24 November, first stab at release version
@
text
@d8 1
a8 1
# $Id: getchapternumbers,v 1.2 1996/05/06 08:58:31 grog Exp grog $
d11 3
@


1.2
log
@Minor mods
@
text
@d8 1
a8 1
# $Id: getchapternumbers,v 1.1 1996/04/06 12:30:52 grog Exp grog $
d11 3
d22 1
a22 1
.ds \1 Chapter \\\*\[n\1], \\fI\2\\fP:'
d26 1
a26 1
.ds \1 Appendix \\\*\[n\1], \\fI\2\\fP:'
@


1.1
log
@Initial revision
@
text
@d8 1
a8 1
# $Id$
d10 6
a15 1
# $Log$
d18 1
a18 1
egrep '^\.Chapter' $* | sed 's:^.*\[n\(.*\)\] *"\(.*\)":.ds n\1 \\n+(CN\
d22 1
a22 1
egrep '^\.Appendix' $* | sed 's:^.*\[n\(.*\)\] *"\(.*\)":.ds n\1 \\N\'\'\\\\n+[AN]\''\
@
