Debian Codegraph @

scripts/newmacros

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