| 1 | #! /bin/bash
|
|---|
| 2 | #
|
|---|
| 3 | # original from:
|
|---|
| 4 | # @(#) pages.sh 1.0 92/09/26
|
|---|
| 5 | # 92/09/05 John H. DuBois III ([email protected])
|
|---|
| 6 | # 92/09/26 Added help
|
|---|
| 7 | #
|
|---|
| 8 | # conversion to bash v2 syntax by Chet Ramey
|
|---|
| 9 |
|
|---|
| 10 | Usage="$0 [-h] [-n lines/page] page-ranges [file ...]"
|
|---|
| 11 |
|
|---|
| 12 | usage()
|
|---|
| 13 | {
|
|---|
| 14 | echo "$Usage" 1>&2
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | phelp()
|
|---|
| 18 | {
|
|---|
| 19 | echo "$0: print selected pages.
|
|---|
| 20 | Usage: $Usage
|
|---|
| 21 |
|
|---|
| 22 | If no file names are given, the standard input is read.
|
|---|
| 23 |
|
|---|
| 24 | The input is grouped into pages and a selected subset of them is printed.
|
|---|
| 25 | Formfeeds are acted on correctly.
|
|---|
| 26 |
|
|---|
| 27 | If the output device does automatic line wrap, lines that longer than
|
|---|
| 28 | the width of the output device will result in incorrect output.
|
|---|
| 29 | The first non-option argument is a list of pages to print.
|
|---|
| 30 |
|
|---|
| 31 | Pages are given as a list of ranges separated by commas.
|
|---|
| 32 | A range is either one number, two numbers separted by a dash,
|
|---|
| 33 | or one number followed by a dash. A range consisting of one
|
|---|
| 34 | number followed by a dash extends to the end of the document.
|
|---|
| 35 |
|
|---|
| 36 | Options:
|
|---|
| 37 | -n sets the number of lines per page to n. The default is 66."
|
|---|
|
|---|