3 @ Do something on the current file
8 @ Do something on the tagged files
9 set %t; CMD=%{Enter command}
16 0 Edit a bug report and send it to root
17 I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1
19 test -r $I && mail root < $I
22 =+ f \.1$ | f \.3$ | f \.4$ | f \.5$ | f \.6$ | f \.7$ | f \.8$ | f \.man$ & t r
23 1 Display the file with roff -man
26 2 Call the info hypertext browser
30 3 Compress the current subdirectory (tar.gz)
32 echo -n "Name of the compressed file (without extension) [$Pwd]: "
34 if [ "$tar"x = x ]; then tar="$Pwd"; fi
36 tar cf - "$Pwd" | gzip -f9 > "$tar.tar.gz" && \
37 echo "../$tar.tar.gz created."
39 4 Compress the current subdirectory (tar.bz2)
41 echo -n "Name of the compressed file (without extension) [$Pwd]: "
43 if [ "$tar"x = x ]; then tar="$Pwd"; fi
45 tar cf - "$Pwd" | bzip2 -f > "$tar.tar.bz2" && \
46 echo "../$tar.tar.bz2 created."
49 + f \.c$ & t r & ! t t
50 5 Compile and link current .c file
51 make `basename %f .c` 2>/dev/null || cc -O -o `basename %f .c` %f
54 a Append file to opposite
58 A Append files to opposite files
66 d Delete file if a copy exists in the other directory.
67 if [ "%d" = "%D" ]; then
68 echo "The two directores must be different"
71 if [ -f %D/%f ]; then # if two of them, then
72 if cmp -s %D/%f %f; then
73 rm %f && echo %f: DELETED
75 echo "%f and %D/%f differ: NOT deleted"
76 echo -n "Press RETURN "
80 echo %f: No copy in %D/%f: NOT deleted.
84 D Delete tagged files if a copy exists in the other directory.
85 if [ "%d" = "%D" ]; then
86 echo "The two directores must be different"
94 if [ "$SUM1" = "$SUM2" ]; then
95 rm $i && echo ${i}: DELETED
97 echo $i and %D/$i differ: NOT deleted.
100 echo %f has no copy in %D/%f: NOT deleted.
105 MAN=%{Enter manual name}
106 %view man -P cat $MAN
110 n Inspect gzip'ed newsbatch file
111 dd if=%f bs=1 skip=12|zcat|${PAGER-more}
112 # assuming the cunbatch header is 12 bytes long.
116 h Strip headers from current newsarticle
117 CHECK=`awk '{print $1 ; exit}' %f` 2>/dev/null
120 I=`mktemp ${MC_TMPDIR:-/tmp}/news.XXXXXX` || exit 1
121 cp %f $I && sed '/^'"$CHECK"' /,/^$/d' $I > %f
122 [ "$?" = "0" ] && rm $I
123 echo %f: header removed
126 echo %f is not a news article.
131 H Strip headers from the marked newsarticles
133 while [ -n "$1" ]; do
134 CHECK=`awk '{print $1 ; exit}' $1` 2>/dev/null
135 WFILE=`mktemp ${MC_TMPDIR:-/tmp}/news.XXXXXX` || exit 1
138 cp $1 $WFILE && sed '/^'"$CHECK"' /,/^$/d' $WFILE > $1
139 if [ "$?" = "0" ]; then
140 rm $WFILE; echo $1 header removed. OK.
142 echo "Oops! Please check $1 against $WFILE"
146 echo $1 skipped: Not a news article.
154 r Copy file to remote host
155 echo -n "To which host?: "
157 echo -n "To which directory on $Host?: "
159 rcp -p %f ${Host}:$Dir
162 R Copy files to remote host (no error checking)
163 echo -n "Copy files to which host?: "
165 echo -n "To which directory on $Host? :"
167 rcp -pr %u ${Host}:$Dir
170 + f \.tex$ & t r & ! t t
171 t Run latex on file and show it with xdvi
172 latex %f && xdvi `basename %f .tex`.dvi
174 =+ f ^part | f ^Part | f uue & t r
176 U Uudecode marked news articles (needs work)
179 while [ -n "$1" ]; do # strip headers
180 FIRST=`awk '{print $1 ; exit}' $1`
181 cat $1 | sed '/^'"$FIRST"' /,/^$/d'; shift
183 ) |sed '/^$/d' |sed -n '/^begin 6/,/^end$/p' | uudecode
184 if [ "$?" != "0" ]; then
185 echo "Cannot decode %t"
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 $i .tar.gz`";;
265 *.tgz) D="`basename $i .tgz`";;
266 *.tpz) D="`basename $i .tpz`";;
267 *.tar.Z) D="`basename $i .tar.Z`";;
268 *.tar.z) D="`basename $i .tar.z`";;
269 *.tar.F) D="`basename $i .tar.F`"; set freeze -dc;;
270 *.tar.bz2) D="`basename $i .tar.bz2`"; set bunzip2 -c;;
272 mkdir $D; (cd $D && $1 $2 ../$i | tar xvf -)
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
288 tgz|tpz) D="`basename %f .$EXT`.tar";;
289 gz|Z|z) D="`basename %f .$EXT`";;
290 bz2) D="`basename %f .bz2`";;
292 if [ "$EXT" = "bz2" ]; then
293 bunzip2 -v %f ; gzip -f9 -v $D
295 gunzip -v %f ; bzip2 -v $D
299 C Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2
314 tgz) D="`basename $1 .tgz`.tar";;
315 tpz) D="`basename $1 .tpz`.tar";;
316 gz|Z|z) D="`basename $1 .$EXT`";;
317 bz2) D="`basename $1 .bz2`";;
319 if [ "$EXT" = "bz2" ]; then
329 + x /usr/bin/open | x /usr/local/bin/open & x /bin/sh
330 o Open next a free console