summaryrefslogtreecommitdiff
path: root/mc/mc.menu
blob: 588b6a947f602c95911225501f83335e7e062381 (plain)
  1. shell_patterns=0
  2. + ! t t
  3. @ Do something on the current file
  4. CMD=%{Enter command}
  5. $CMD %f
  6. + t t
  7. @ Do something on the tagged files
  8. set %t; CMD=%{Enter command}
  9. while [ -n "$1" ]; do
  10. $CMD "$1"
  11. shift
  12. done
  13. 0 Edit a bug report and send it to root
  14. I=`mktemp "${MC_TMPDIR:-/tmp}/mail.XXXXXX"` || exit 1
  15. ${EDITOR-vi} "$I"
  16. test -r $I && mail root < $I
  17. rm -f "$I"
  18. =+ f \.1$ | f \.3$ | f \.4$ | f \.5$ | f \.6$ | f \.7$ | f \.8$ | f \.man$ & t r
  19. 1 Display the file with roff -man
  20. nroff -man %f | less
  21. 2 Call the info hypertext browser
  22. info
  23. = t d
  24. 3 Compress the current subdirectory (tar.gz)
  25. Pwd=`basename %d /`
  26. echo -n "Name of the compressed file (without extension) [$Pwd]: "
  27. read tar
  28. if [ "$tar"x = x ]; then tar="$Pwd"; fi
  29. cd .. && \
  30. tar cf - "$Pwd" | gzip -f9 > "$tar.tar.gz" && \
  31. echo "../$tar.tar.gz created."
  32. 4 Compress the current subdirectory (tar.bz2)
  33. Pwd=`basename %d /`
  34. echo -n "Name of the compressed file (without extension) [$Pwd]: "
  35. read tar
  36. if [ "$tar"x = x ]; then tar="$Pwd"; fi
  37. cd .. && \
  38. tar cf - "$Pwd" | bzip2 -f > "$tar.tar.bz2" && \
  39. echo "../$tar.tar.bz2 created."
  40. 5 Compress the current subdirectory (tar.7z)
  41. Pwd=`basename %d /`
  42. echo -n "Name of the compressed file (without extension) [$Pwd]: "
  43. read tar
  44. if [ "$tar"x = x ]; then tar="$Pwd"; fi
  45. cd .. && \
  46. tar cf - "$Pwd" | 7za a -si "$tar.tar.7z" && \
  47. echo "../$tar.tar.7z created."
  48. 6 Compress the current subdirectory (tar.xz)
  49. Pwd=`basename %d /`
  50. echo -n "Name of the compressed file (without extension) [$Pwd]: "
  51. read tar
  52. if [ "$tar"x = x ]; then tar="$Pwd"; fi
  53. cd .. && \
  54. tar cf - "$Pwd" | xz -f > "$tar.tar.xz" && \
  55. echo "../$tar.tar.xz created."
  56. = f \.c$ & t r
  57. + f \.c$ & t r & ! t t
  58. с Compile and link current .c file
  59. make `basename %f .c` 2>/dev/null || cc -O -o `basename %f .c` %f
  60. + t r & ! t t
  61. a Append file to opposite
  62. cat %f >> %D/%f
  63. + t t
  64. A Append files to opposite files
  65. set %t
  66. while [ -n "$1" ]; do
  67. cat "$1" >> "%D/$1"
  68. shift
  69. done
  70. + t r & ! t t
  71. d Delete file if a copy exists in the other directory.
  72. if [ "%d" = "%D" ]; then
  73. echo "The two directories must be different."
  74. exit 1
  75. fi
  76. if [ -f %D/%f ]; then # if two of them, then
  77. if cmp -s %D/%f %f; then
  78. rm %f && echo "%f: DELETED."
  79. else
  80. echo "%f and %D/%f differ: NOT deleted."
  81. echo -n "Press RETURN "
  82. read key
  83. fi
  84. else
  85. echo "%f: No copy in %D/%f: NOT deleted."
  86. fi
  87. + t t
  88. D Delete tagged files if a copy exists in the other directory.
  89. if [ "%d" = "%D" ]; then
  90. echo "The two directores must be different."
  91. exit 1
  92. fi
  93. for i in %t
  94. do
  95. if [ -f "%D/$i" ]; then
  96. SUM1="`sum $i`"
  97. SUM2="`sum %D/$i`"
  98. if [ "$SUM1" = "$SUM2" ]; then
  99. rm "$i" && echo "${i}: DELETED."
  100. else
  101. echo "$i and %D/$i differ: NOT deleted."
  102. fi
  103. else
  104. echo "%i has no copy in %D: NOT deleted."
  105. fi
  106. done
  107. m View manual page
  108. MAN=%{Enter manual name}
  109. %view man -P cat $MAN
  110. = f \.gz$ & t r
  111. + ! t t
  112. n Inspect gzip'ed newsbatch file
  113. dd if=%f bs=1 skip=12|zcat|${PAGER-more}
  114. # assuming the cunbatch header is 12 bytes long.
  115. = t r &
  116. + ! t t
  117. h Strip headers from current newsarticle
  118. CHECK=`awk '{print $1 ; exit}' %f` 2>/dev/null
  119. case "$CHECK" in
  120. Newsgroups:|Path:)
  121. I=`mktemp "${MC_TMPDIR:-/tmp}/news.XXXXXX"` || exit 1
  122. cp %f "$I" && sed '/^'"$CHECK"' /,/^$/d' "$I" > %f
  123. [ "$?" = "0" ] && rm "$I"
  124. echo "%f: header removed."
  125. ;;
  126. *)
  127. echo "%f is not a news article."
  128. ;;
  129. esac
  130. + t t
  131. H Strip headers from the marked newsarticles
  132. set %t
  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
  136. case "$CHECK" in
  137. Newsgroups:|Path:)
  138. cp "$1" "$WFILE" && sed '/^'"$CHECK"' /,/^$/d' "$WFILE" > "$1"
  139. if [ "$?" = "0" ]; then
  140. rm "$WFILE"; echo "$1 header removed. OK."
  141. else
  142. echo "Oops! Please check $1 against $WFILE."
  143. fi
  144. ;;
  145. *)
  146. echo "$1 skipped: Not a news article."
  147. ;;
  148. esac
  149. shift
  150. done
  151. = t r
  152. + ! t t
  153. r Copy file to remote host
  154. echo -n "To which host?: "
  155. read Host
  156. echo -n "To which directory on $Host?: "
  157. read Dir
  158. rcp -p %f "${Host}:$Dir"
  159. + t t
  160. R Copy files to remote host (no error checking)
  161. echo -n "Copy files to which host?: "
  162. read Host
  163. echo -n "To which directory on $Host? :"
  164. read Dir
  165. rcp -pr %u "${Host}:$Dir"
  166. =+ f ^part | f ^Part | f uue & t r
  167. + t t
  168. U Uudecode marked news articles (needs work)
  169. set %t
  170. (
  171. while [ -n "$1" ]; do # strip headers
  172. FIRST=`awk '{print $1 ; exit}' "$1"`
  173. cat "$1" | sed '/^'"$FIRST"' /,/^$/d'; shift
  174. done
  175. ) |sed '/^$/d' |sed -n '/^begin 6/,/^end$/p' | uudecode
  176. if [ "$?" != "0" ]; then
  177. echo "Cannot decode %t."
  178. fi
  179. echo "Please test the output file before deleting anything."
  180. =+ 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
  181. x Extract the contents of a compressed tar file
  182. unset PRG
  183. case %f in
  184. *.tar.bz2)
  185. PRG="bunzip2 -c"
  186. ;;
  187. *.tar.gz|*.tar.z|*.tgz|*.tpz|*.tar.Z)
  188. PRG="gzip -dc"
  189. ;;
  190. *.tar.lzma)
  191. PRG="lzma -dc"
  192. ;;
  193. *.tar.lz)
  194. PRG="lzip -dc"
  195. ;;
  196. *.tar.xz)
  197. PRG="xz -dc"
  198. ;;
  199. *.tar.7z)
  200. PRG="7za e -so"
  201. ;;
  202. *)
  203. exit 1
  204. ;;
  205. esac
  206. $PRG %f | tar xvf -
  207. = t r
  208. + ! t t
  209. y Gzip or gunzip current file
  210. unset DECOMP
  211. case %f in
  212. *.gz) DECOMP=-d;;
  213. *.[zZ]) DECOMP=-d;;
  214. esac
  215. gzip $DECOMP -v %f
  216. + t t
  217. Y Gzip or gunzip tagged files
  218. for i in %t
  219. do
  220. unset DECOMP
  221. case "$i" in
  222. *.gz) DECOMP=-d;;
  223. *.[zZ]) DECOMP=-d;;
  224. esac
  225. gzip $DECOMP -v "$i"
  226. done
  227. + ! t t
  228. b Bzip2 or bunzip2 current file
  229. unset DECOMP
  230. case %f in
  231. *.bz2) DECOMP=-d;;
  232. esac
  233. bzip2 $DECOMP -v %f
  234. + t t
  235. B Bzip2 or bunzip2 tagged files
  236. for i in %t
  237. do
  238. unset DECOMP
  239. case "$i" in
  240. *.bz2) DECOMP=-d;;
  241. esac
  242. bzip2 $DECOMP -v "$i"
  243. done
  244. + f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ | f \.tar.F$ & t r & ! t t
  245. z Extract compressed tar file to subdirectory
  246. unset D
  247. set gzip -cd
  248. case %f in
  249. *.tar.gz) D="`basename %f .tar.gz`";;
  250. *.tgz) D="`basename %f .tgz`";;
  251. *.tpz) D="`basename %f .tpz`";;
  252. *.tar.Z) D="`basename %f .tar.Z`";;
  253. *.tar.z) D="`basename %f .tar.z`";;
  254. *.tar.bz2) D="`basename %f .tar.bz2`"; set bunzip2 -c ;;
  255. *.tar.F) D="`basename %f .tar.F`"; set freeze -dc;
  256. esac
  257. mkdir "$D"; cd "$D" && ("$1" "$2" ../%f | tar xvf -)
  258. + t t
  259. Z Extract compressed tar files to subdirectories
  260. for i in %t
  261. do
  262. set gzip -dc
  263. unset D
  264. case "$i" in
  265. *.tar.gz) D="`basename $i .tar.gz`";;
  266. *.tgz) D="`basename $i .tgz`";;
  267. *.tpz) D="`basename $i .tpz`";;
  268. *.tar.Z) D="`basename $i .tar.Z`";;
  269. *.tar.z) D="`basename $i .tar.z`";;
  270. *.tar.F) D="`basename $i .tar.F`"; set freeze -dc;;
  271. *.tar.bz2) D="`basename $i .tar.bz2`"; set bunzip2 -c;;
  272. esac
  273. mkdir "$D"; (cd "$D" && "$1" "$2" "../$i" | tar xvf -)
  274. done
  275. + x /usr/bin/open | x /usr/local/bin/open & x /bin/sh
  276. o Open next a free console
  277. open -s -- sh
  278. + F \.tar\.gz$ | + F \.tgz$ | F \.tar\.bz2$ & ! T T
  279. t gbp import-orig current file in opposite dir
  280. gbp import-orig --pristine-tar --sign-tags --filter=.gitignore %D/%F
  281. + F \.dsc$ & ! T T
  282. t gbp import-dsc current file in opposite dir
  283. gbp import-dsc --pristine-tar --sign-tags %D/%F
  284. c Create unofficial changelog entry
  285. PREVDIST=$(dpkg-parsechangelog -S Distribution)
  286. DOMAIN=$(dnsdomainname)
  287. dch -D "$PREVDIST-$DOMAIN" -l "~0$DOMAIN" --force-distribution "Local build based on Debian $PREVDIST packaging."