3 @ Do something on the current file
8 @ Do something on the tagged files
9 set %u; CMD=%0{Enter command}
11 $CMD "$1" || echo tag "$1" >>$MC_CONTROL_FILE
16 0 Edit a bug report and send it to root
17 ${EDITOR-vi} /tmp/mail.$$
18 test -r /tmp/mail.$$ && mail root < /tmp/mail.$$
21 =+ f \.1$ | f \.3$ | f \.4$ | f \.5$ | f \.6$ | f \.7$ | f \.8$ | f \.man$ & t r
22 1 Display the file with roff -man
25 2 Call the info hypertext browser
29 3 Make a release of the current subdirectory (tar.gz)
31 echo -n "Name of the distribution file (without extension) [$Pwd]: "
33 if [ "$tar"x = x ]; then tar=$Pwd; fi
34 cd .. && tar chf - $Pwd | gzip -f9 > $tar.tar.gz
35 echo ../${tar}.tar.gz created.
36 # tar=%{Name of the distribution file (without extension)}
38 4 Make a release of the current subdirectory (tar.bz2)
40 echo -n "Name of the distribution file (without extension) [$Pwd]: "
42 if [ "$tar"x = x ]; then tar=$Pwd; fi
43 cd .. && tar chf - $Pwd | bzip2 -f --repetitive-best > $tar.tar.bz2
44 echo ../${tar}.tar.bz2 created.
45 # tar=%{Name of the distribution file (without extension)}
48 + f \.c$ & t r & ! t t
49 5 Compile and link current .c file
50 make `basename %f .c` 2>/dev/null || cc -O -o `basename %f .c` %f
53 a Append file to opposite
57 A Append files to opposite files
60 cat $1 >>%D/$1 || echo tag $1 >>$MC_CONTROL_FILE
65 d Delete file if a copy exists in the other directory.
66 if [ "%d" = "%D" ]; then
67 echo "The two directores must be different"
70 if [ -f %D/%f ]; then # if two of them, then
71 if cmp -s %D/%f %f; then
72 rm %f && echo %f: DELETED
74 echo "%f and %D/%f differ: NOT deleted"
75 echo -n "Press RETURN "
79 echo %f: No copy in %D/%f: NOT deleted.
83 D Delete tagged files if a copy exists in the other directory.
84 if [ "%d" = "%D" ]; then
85 echo "The two directores must be different"
93 if [ "$SUM1" = "$SUM2" ]; then
94 rm $i && echo ${i}: DELETED
96 echo $i and %D/$i differ: NOT deleted.
99 echo %f has no copy in %D/%f: NOT deleted.
105 n Inspect gzip'ed newsbatch file
106 dd if=%f bs=1 skip=12|zcat|${PAGER-more}
107 # assuming the cunbatch header is 12 bytes long.
111 h Strip headers from current newsarticle
112 CHECK=`sed 1q < %f|awk '{print $1}'` 2>/dev/null
115 cp %f /tmp/%f.$$ && sed '/^'"$CHECK"' /,/^$/d' /tmp/%f.$$ > %f
116 [ "$?" = "0" ] && rm /tmp/%f.$$
117 echo %f: header removed
120 echo %f is not a news article.
125 H Strip headers from the marked newsarticles
127 while [ -n "$1" ]; do
128 CHECK=`sed 1q < $1|awk '{print $1}'` 2>/dev/null
132 cp $1 $WFILE && sed '/^'"$CHECK"' /,/^$/d' $WFILE > $1
133 if [ "$?" = "0" ]; then
134 rm $WFILE; echo $1 header removed. OK.
136 echo tag $1 >>$MC_CONTROL_FILE
137 echo "Oops! Please check $1 against $WFILE"
141 echo $1 skipped: Not a news article.
142 echo tag $1 >>$MC_CONTROL_FILE
150 r Copy file to remote host
151 echo -n "To which host?: "
153 echo -n "To which directory on $Host?: "
155 rcp -p %f ${Host}:$Dir
158 R Copy files to remote host (no error checking)
159 echo -n "Copy files to which host?: "
161 echo -n "To which directory on $Host? :"
163 rcp -pr %u ${Host}:$Dir
166 + f \.tex$ & t r & ! t t
167 t Run latex on file and show it with xdvi
168 latex %f && xdvi `basename %f .tex`.dvi
170 =+ f ^part | f ^Part | f uue & t r
172 U Uudecode marked news articles (needs work)
175 while [ -n "$1" ]; do # strip headers
176 FIRST=`sed 1q < $1|awk '{print $1}'`
177 cat $1 | sed '/^'"$FIRST"' /,/^$/d'; shift
179 ) |sed '/^$/d' |sed -n '/^begin 6/,/^end$/p' | uudecode
180 if [ "$?" != "0" ]; then
181 echo "Could not decode %t"
183 echo tag $i >>$MC_CONTROL_FILE
187 echo "Please test the output file before deleting anything"
189 =+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.Z$| f \.tar\.bz2$ & t r
190 x Extract the contents of a compressed tar file
192 echo %f|egrep -q "\.tar.bz2$" && EXT=tar_bz2
193 if [ "$EXT" = "tar_bz2" ]; then
194 bunzip2 -c %f | tar xvf -
196 gzip -dc %f | tar xvf -
201 y Gzip or gunzip current file
203 echo %f|egrep -q "\.gz$|\.z$|\.Z$" && DECOMP=-d
207 Y Gzip or gunzip tagged files
211 echo $i|egrep -q "\.gz$|\.z$|\.Z$" && DECOMP=-d
216 b Bzip2 or bunzip2 current file
218 echo %f|egrep -q "\.bz2$" && DECOMP=-d
222 B Bzip2 or bunzip2 tagged files
226 echo $i|egrep -q "\.bz2$" && DECOMP=-d
230 + f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ & t r & ! t t
231 z Extract compressed tar file to subdirectory
233 echo %f|egrep -q "\.tar.gz$" && EXT=tar_gz
234 echo %f|egrep -q "\.tgz$" && EXT=tgz
235 echo %f|egrep -q "\.tpz$" && EXT=tpz
236 echo %f|egrep -q "\.tar.Z$" && EXT=tar_Z
237 echo %f|egrep -q "\.tar.z$" && EXT=tar_z
238 echo %f|egrep -q "\.tar.bz2$" && EXT=tar_bz2
240 tar_gz) D="`basename %f .tar.gz`";;
241 tgz) D="`basename %f .tgz`";;
242 tpz) D="`basename %f .tpz`";;
243 tar_Z) D="`basename %f .tar.Z`";;
244 tar_z) D="`basename %f .tar.z`";;
245 tar_bz2) D="`basename %f .tar.bz2`";;
247 if [ "$EXT" = "tar_bz2" ]; then
248 mkdir $D; cd $D && (bunzip2 -c ../%f | tar xvf -)
250 mkdir $D; cd $D && (gzip -dc ../%f | tar xvf -)
253 + f \.tar.F$ & t r & ! t t
254 z Extract compressed tar file to subdirectory
256 echo %f|egrep -q "\.tar.F$" && EXT=tar_F
258 tar_F) D="`basename %f .tar.F`";;
260 mkdir $D; cd $D && (freeze -dc ../%f | tar xvf -)
263 Z Extract compressed tar files to subdirectories
268 echo $1|egrep -q "\.tar.gz$" && EXT=tar_gz
269 echo $1|egrep -q "\.tgz$" && EXT=tgz
270 echo $1|egrep -q "\.tpz$" && EXT=tpz
271 echo $1|egrep -q "\.tar.Z$" && EXT=tar_Z
272 echo $1|egrep -q "\.tar.z$" && EXT=tar_z
273 echo $1|egrep -q "\.tar.F$" && EXT=tar_F
274 echo $1|egrep -q "\.tar.bz2$" && EXT=tar_bz2
276 tar_gz) D="`basename $1 .tar.gz`";;
277 tgz) D="`basename $1 .tgz`";;
278 tpz) D="`basename $1 .tpz`";;
279 tar_Z) D="`basename $1 .tar.Z`";;
280 tar_z) D="`basename $1 .tar.z`";;
281 tar_F) D="`basename $1 .tar.F`";;
282 tar_bz2) D="`basename $1 .tar.bz2`";;
285 tar_gz|tgz|tpz|tar_Z|tar_z) mkdir $D; (cd $D && gzip -dc ../$1 | tar xvf -)||echo tag $1 >>$MC_CONTROL_FILE;;
286 tar_F) mkdir $D; (cd $D && freeze -dc ../$1 | tar xvf -)||echo tag $1 >>$MC_CONTROL_FILE;;
287 tar_bz2) mkdir $D; (cd $D && bunzip2 -c ../$1 | tar xvf -)||echo tag $1 >>$MC_CONTROL_FILE
291 + f \.gz$ | f \.tgz$ | f \.tpz$ | f \.Z$ | f \.z$ | f \.bz2$ & t r & ! t t
292 c Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2
294 echo %f|egrep -q "\.tgz$" && EXT=tgz
295 echo %f|egrep -q "\.tpz$" && EXT=tpz
296 echo %f|egrep -q "\.Z$" && EXT=Z
297 echo %f|egrep -q "\.z$" && EXT=z
298 echo %f|egrep -q "\.gz$" && EXT=gz
299 echo %f|egrep -q "\.bz2$" && EXT=bz2
301 tgz) D="`basename %f .tgz`.tar";;
302 tpz) D="`basename %f .tpz`.tar";;
303 gz) D="`basename %f .gz`";;
304 bz2) D="`basename %f .bz2`";;
306 if [ "$EXT" = "bz2" ]; then
307 bunzip2 -v %f ; gzip -f9 -v $D
309 gunzip -v %f ; bzip2 -v --repetitive-best $D
313 C Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2
318 echo %f|egrep -q "\.tgz$" && EXT=tgz
319 echo %f|egrep -q "\.tpz$" && EXT=tpz
320 echo %f|egrep -q "\.Z$" && EXT=Z
321 echo %f|egrep -q "\.z$" && EXT=z
322 echo %f|egrep -q "\.gz$" && EXT=gz
323 echo %f|egrep -q "\.bz2$" && EXT=bz2
325 tgz) D="`basename $1 .tgz`.tar";;
326 tpz) D="`basename $1 .tpz`.tar";;
327 gz) D="`basename $1 .gz`";;
328 bz2) D="`basename $1 .bz2`";;
330 if [ "$EXT" = "bz2" ]; then
331 (bunzip2 -v $1 ; gzip -f9 -v $D)||echo tag $1 >>$MC_CONTROL_FILE
333 (gunzip -v $1 ; bzip2 -v --repetitive-best $D)||echo tag $1 >>$MC_CONTROL_FILE