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=`awk '{print $1 ; exit}' %f` 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=`awk '{print $1 ; exit}' $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=`awk '{print $1 ; exit}' $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
193 *.tar.bz2) EXT=tar_bz2;;
195 if [ "$EXT" = "tar_bz2" ]; then
196 bunzip2 -c %f | tar xvf -
198 gzip -dc %f | tar xvf -
203 y Gzip or gunzip current file
212 Y Gzip or gunzip tagged files
224 b Bzip2 or bunzip2 current file
232 B Bzip2 or bunzip2 tagged files
242 + f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ | f \.tar.F$ & t r & ! t t
243 z Extract compressed tar file to subdirectory
247 *.tar.gz) D="`basename %f .tar.gz`";;
248 *.tgz) D="`basename %f .tgz`";;
249 *.tpz) D="`basename %f .tpz`";;
250 *.tar.Z) D="`basename %f .tar.Z`";;
251 *.tar.z) D="`basename %f .tar.z`";;
252 *.tar.bz2) D="`basename %f .tar.bz2`"; set bunzip2 -c ;;
253 *.tar.F) D="`basename %f .tar.F`"; set freeze -dc;
255 mkdir $D; cd $D && ($1 $2 ../%f | tar xvf -)
258 Z Extract compressed tar files to subdirectories
264 *.tar.gz) D="`basename $1 .tar.gz`";;
265 *.tgz) D="`basename $1 .tgz`";;
266 *.tpz) D="`basename $1 .tpz`";;
267 *.tar.Z) D="`basename $1 .tar.Z`";;
268 *.tar.z) D="`basename $1 .tar.z`";;
269 *.tar.F) D="`basename $1 .tar.F`"; set freeze -dc;;
270 *.tar.bz2) D="`basename $1 .tar.bz2`"; set bunzip2 -c;;
272 mkdir $D; (cd $D && $1 $2 ../$i | tar xvf -)||echo tag $i >>$MC_CONTROL_FILE
275 + f \.gz$ | f \.tgz$ | f \.tpz$ | f \.Z$ | f \.z$ | f \.bz2$ & t r & ! t t
276 c Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2
287 tgz|tpz) D="`basename %f .$EXT`.tar";;
288 gz|Z|z) D="`basename %f .$EXT`";;
289 bz2) D="`basename %f .bz2`";;
291 if [ "$EXT" = "bz2" ]; then
292 bunzip2 -v %f ; gzip -f9 -v $D
294 gunzip -v %f ; bzip2 -v --repetitive-best $D
298 C Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2
312 tgz) D="`basename $1 .tgz`.tar";;
313 tpz) D="`basename $1 .tpz`.tar";;
314 gz|Z|z) D="`basename $1 .$EXT`";;
315 bz2) D="`basename $1 .bz2`";;
317 if [ "$EXT" = "bz2" ]; then
318 (bunzip2 -v $1 ; gzip -f9 -v $D)||echo tag $1 >>$MC_CONTROL_FILE
320 (gunzip -v $1 ; bzip2 -v --repetitive-best $D)||echo tag $1 >>$MC_CONTROL_FILE
325 + x /usr/bin/open | x /usr/local/bin/open & x /bin/sh
326 o Open next a free console