Last change
on this file was
2336,
checked in by westram, 21 years ago
|
- removed 'ig' (Solaris does not like that)
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
523 bytes
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | if [ -z "$4" ] ; then |
---|
4 | echo "Usage: genhelp.sh outputfile title header inputtext" |
---|
5 | echo " Generates help pre-source 'outputfile' from 'inputtext'" |
---|
6 | exit 1 |
---|
7 | fi |
---|
8 | |
---|
9 | OUTPUTFILE=$1 |
---|
10 | TITLE=$2 |
---|
11 | HEADER=$3 |
---|
12 | INPUTTEXT=$4 |
---|
13 | |
---|
14 | if [ \! -f $HEADER ]; then |
---|
15 | echo "Header '$HEADER' not found" |
---|
16 | exit 1 |
---|
17 | fi |
---|
18 | if [ \! -f $INPUTTEXT ]; then |
---|
19 | echo "Input '$INPUTTEXT' not found" |
---|
20 | exit 1 |
---|
21 | fi |
---|
22 | |
---|
23 | write_help() { |
---|
24 | echo "$TITLE" |
---|
25 | echo "" |
---|
26 | cat $HEADER |
---|
27 | sed -e 's/^/ /' < $INPUTTEXT |
---|
28 | } |
---|
29 | |
---|
30 | write_help > $OUTPUTFILE |
---|
Note: See
TracBrowser
for help on using the repository browser.