source: vendor/bash/3.1/examples/scripts.v2/pages@ 3228

Last change on this file since 3228 was 3228, checked in by bird, 19 years ago

bash 3.1

File size: 4.5 KB
Line 
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
10Usage="$0 [-h] [-n lines/page] page-ranges [file ...]"
11
12usage()
13{
14 echo "$Usage" 1>&2
15}
16
17phelp()
18{
19echo "$0: print selected pages.
20Usage: $Usage
21
22If no file names are given, the standard input is read.
23
24The input is grouped into pages and a selected subset of them is printed.
25Formfeeds are acted on correctly.
26
27If the output device does automatic line wrap, lines that longer than
28the width of the output device will result in incorrect output.
29The first non-option argument is a list of pages to print.
30
31Pages are given as a list of ranges separated by commas.
32A range is either one number, two numbers separted by a dash,
33or one number followed by a dash. A range consisting of one
34number followed by a dash extends to the end of the document.
35
36Options:
37-n sets the number of lines per page to n. The default is 66."