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."
48 5 Compress the current subdirectory (tar.7z)
50 echo -n "Name of the compressed file (without extension) [$Pwd]: "
52 if [ "$tar"x = x ]; then tar="$Pwd"; fi
54 tar cf - "$Pwd" | 7za a -si "$tar.tar.7z" && \
55 echo "../$tar.tar.7z created."
57 6 Compress the current subdirectory (tar.xz)
59 echo -n "Name of the compressed file (without extension) [$Pwd]: "
61 if [ "$tar"x = x ]; then tar="$Pwd"; fi
63 tar cf - "$Pwd" | xz -f > "$tar.tar.xz" && \
64 echo "../$tar.tar.xz created."
67 + f \.c$ & t r & ! t t
68 с Compile and link current .c file
69 make `basename %f .c` 2>/dev/null || cc -O -o `basename %f .c` %f
72 a Append file to opposite
76 A Append files to opposite files
84 d Delete file if a copy exists in the other directory.
85 if [ "%d" = "%D" ]; then
86 echo "The two directories must be different."
89 if [ -f %D/%f ]; then # if two of them, then
90 if cmp -s %D/%f %f; then
91 rm %f && echo "%f: DELETED."
93 echo "%f and %D/%f differ: NOT deleted."
94 echo -n "Press RETURN "
98 echo "%f: No copy in %D/%f: NOT deleted."
102 D Delete tagged files if a copy exists in the other directory.
103 if [ "%d" = "%D" ]; then
104 echo "The two directores must be different."
109 if [ -f "%D/$i" ]; then
112 if [ "$SUM1" = "$SUM2" ]; then
113 rm "$i" && echo "${i}: DELETED."
115 echo "$i and %D/$i differ: NOT deleted."
118 echo "%i has no copy in %D: NOT deleted."
123 MAN=%{Enter manual name}
124 %view man -P cat $MAN
128 n Inspect gzip'ed newsbatch file
129 dd if=%f bs=1 skip=12|zcat|${PAGER-more}
130 # assuming the cunbatch header is 12 bytes long.
134 h Strip headers from current newsarticle
135 CHECK=`awk '{print $1 ; exit}' %f` 2>/dev/null
138 I=`mktemp "${MC_TMPDIR:-/tmp}/news.XXXXXX"` || exit 1
139 cp %f "$I" && sed '/^'"$CHECK"' /,/^$/d' "$I" > %f
140 [ "$?" = "0" ] && rm "$I"
141 echo "%f: header removed."
144 echo "%f is not a news article."
149 H Strip headers from the marked newsarticles
151 while [ -n "$1" ]; do
152 CHECK=`awk '{print $1 ; exit}' $1` 2>/dev/null
153 WFILE=`mktemp "${MC_TMPDIR:-/tmp}/news.XXXXXX"` || exit 1
156 cp "$1" "$WFILE" && sed '/^'"$CHECK"' /,/^$/d' "$WFILE" > "$1"
157 if [ "$?" = "0" ]; then
158 rm "$WFILE"; echo "$1 header removed. OK."
160 echo "Oops! Please check $1 against $WFILE."
164 echo "$1 skipped: Not a news article."
172 r Copy file to remote host
173 echo -n "To which host?: "
175 echo -n "To which directory on $Host?: "
177 rcp -p %f "${Host}:$Dir"
180 R Copy files to remote host (no error checking)
181 echo -n "Copy files to which host?: "
183 echo -n "To which directory on $Host? :"
185 rcp -pr %u "${Host}:$Dir"
188 + f \.tex$ & t r & ! t t
189 t Run latex on file and show it with xdvi
190 latex %f && xdvi `basename %f .tex`.dvi
192 =+ f ^part | f ^Part | f uue & t r
194 U Uudecode marked news articles (needs work)
197 while [ -n "$1" ]; do # strip headers
198 FIRST=`awk '{print $1 ; exit}' "$1"`
199 cat "$1" | sed '/^'"$FIRST"' /,/^$/d'; shift
201 ) |sed '/^$/d' |sed -n '/^begin 6/,/^end$/p' | uudecode
202 if [ "$?" != "0" ]; then
203 echo "Cannot decode %t."
205 echo "Please test the output file before deleting anything."
207 =+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.lz$ | f \.tar\.lzma$ | f \.tar\.7z$ | f \.tar\.xz$ | f \.tar\.Z$ | f \.tar\.bz2$ & t r
208 x Extract the contents of a compressed tar file
214 *.tar.gz|*.tar.z|*.tgz|*.tpz|*.tar.Z)
237 y Gzip or gunzip current file
246 Y Gzip or gunzip tagged files
258 b Bzip2 or bunzip2 current file
266 B Bzip2 or bunzip2 tagged files
273 bzip2 $DECOMP -v "$i"
276 + f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ | f \.tar.F$ & t r & ! t t
277 z Extract compressed tar file to subdirectory
281 *.tar.gz) D="`basename %f .tar.gz`";;
282 *.tgz) D="`basename %f .tgz`";;
283 *.tpz) D="`basename %f .tpz`";;
284 *.tar.Z) D="`basename %f .tar.Z`";;
285 *.tar.z) D="`basename %f .tar.z`";;
286 *.tar.bz2) D="`basename %f .tar.bz2`"; set bunzip2 -c ;;
287 *.tar.F) D="`basename %f .tar.F`"; set freeze -dc;
289 mkdir "$D"; cd "$D" && ("$1" "$2" ../%f | tar xvf -)
292 Z Extract compressed tar files to subdirectories
298 *.tar.gz) D="`basename $i .tar.gz`";;
299 *.tgz) D="`basename $i .tgz`";;
300 *.tpz) D="`basename $i .tpz`";;
301 *.tar.Z) D="`basename $i .tar.Z`";;
302 *.tar.z) D="`basename $i .tar.z`";;
303 *.tar.F) D="`basename $i .tar.F`"; set freeze -dc;;
304 *.tar.bz2) D="`basename $i .tar.bz2`"; set bunzip2 -c;;
306 mkdir "$D"; (cd "$D" && "$1" "$2" "../$i" | tar xvf -)
309 + f \.gz$ | f \.tgz$ | f \.tpz$ | f \.Z$ | f \.z$ | f \.bz2$ & t r & ! t t
310 c Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2
322 tgz|tpz) D="`basename %f .$EXT`.tar";;
323 gz|Z|z) D="`basename %f .$EXT`";;
324 bz2) D="`basename %f .bz2`";;
326 if [ "$EXT" = "bz2" ]; then
327 bunzip2 -v %f ; gzip -f9 -v "$D"
329 gunzip -v %f ; bzip2 -v "$D"
333 C Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2
348 tgz) D="`basename $1 .tgz`.tar";;
349 tpz) D="`basename $1 .tpz`.tar";;
350 gz|Z|z) D="`basename $1 .$EXT`";;
351 bz2) D="`basename $1 .bz2`";;
353 if [ "$EXT" = "bz2" ]; then
363 + x /usr/bin/open | x /usr/local/bin/open & x /bin/sh
364 o Open next a free console