PennMUSH Community

root/1.8.3/trunk/game/txt/compose.sh.in

Revision 846, 0.9 kB (checked in by penndev, 1 year ago)

PennMUSH 1.8.3p2 release candidate.

Line 
1 #!/bin/sh
2 #
3 # compose.sh: a shell script for putting together help.txt, etc.
4 #
5 # Usage: compose.sh <directory>
6 # Example: compose.sh help
7 #
8 # This script calls index-files.pl
9 #
10 # By Alan Schwartz (Javelin/Paul)
11 #
12
13 # These come from Configure
14 perl=@PERL@
15 test=@TEST@
16 cat=@CAT@
17 rm=@RM@
18 echo=@ECHO@
19
20 # This process can eat CPU, so uncomment if you want to be nice
21 #/etc/renice +4 $$
22
23 # What subdirectories should we be processing?
24 dir=$1
25 if $test ! -d $dir; then
26   $echo "Usage: compose.sh <directory>"
27   exit 0
28 fi
29
30 index_args=$2
31
32 # Ok, let's do 'em:
33   cd $dir
34
35   # Remove the old index
36   $rm -f index.$dir
37
38   # Build a new index, and tack it on.
39   $echo Building index for $dir...
40   if $test -f $perl; then
41     $cat *.$dir | tee ../$dir.txt | $perl ../index-files.pl $index_args > index.$dir
42     $cat index.$dir >> ../$dir.txt
43   else
44     $cat *.$dir > ../$dir.txt
45   fi
46  
47   cd ..
48
49 $echo Done.
50 $echo Remember to use @readcache if the mush is currently running.
51
Note: See TracBrowser for help on using the browser.