1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#!/bin/bash
if [ $# -eq 0 ] ; then
echo '
Usage: '$0' [-n] [-f] dest-file conversiontype source-path(s)
Where:
-n: nogo option: if specified the commands to be executed are
displayed, but not executed
-f: forced option: first remove an existing dest-file
conversiontype: a supported yodl conversion type (e.g., txt, man, html,
latex)
dest-file: path defining the converted file. Relative paths are
interpreted from the current working directory.
src-path(s): one or more path specifications where the raw macro files to
be converted are located. Multiple source paths are
processed in sequence, and may each use wildcard
specifications.
When called multiple times new information is appended to the dest-file.
'
exit 0
fi
scriptsdir=`dirname $0`
if [ "$1" != "-n" ]
then
go=1
else
go=0
shift
fi
if [ "$1" == '-f' ]
then
rm -f $2
shift
fi
destfile=$1
conversion=$2
shift 2
for src in $*
do
if [ $go -eq 1 ]
then
echo -n .
$scriptsdir/macroseparator.pl $conversion $src >> $destfile
else
echo "$scriptsdir/macroseparator.pl $conversion $src >> $destfile"
fi
done
echo
|