home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / mc454src.zip / mc-4.5.4.src / mc-4.5.4 / lib / mc.menu < prev    next >
Text File  |  1999-01-04  |  6KB  |  238 lines

  1. shell_patterns=0
  2. + ! t t
  3. @       Do something on the current file
  4.     CMD=%{Enter command}
  5.     $CMD ./%0f
  6.  
  7. + t t
  8. @       Do something on the tagged files
  9.     set %u; CMD=%0{Enter command}
  10.     while [ -n "$1" ]; do
  11.       $CMD "$1" || echo tag "$1" >>$MC_CONTROL_FILE
  12.       shift
  13.     done
  14.     
  15.  
  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.$$
  19.     rm -f /tmp/mail.$$
  20.  
  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
  23.     nroff -man %f | less
  24.  
  25. 2       Call the info hypertext browser
  26.         info
  27.  
  28. = t d
  29. 3       Make a release of the current subdirectory
  30.     Pwd=`basename %d /`
  31.     echo -n "Name of the distribution file (without extension) [$Pwd]: "
  32.     read tar
  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)}
  37.  
  38. = f \.c$ & t r
  39. + f \.c$ & t r & ! t t
  40. 5       Compile and link current .c file
  41.         make `basename %f .c` 2>/dev/null || cc -O -o `basename %f .c` %f
  42.  
  43. + t r & ! t t
  44. a       Append file to opposite
  45.     cat %f >>%D/%f
  46.  
  47. + t t
  48. A       Append files to opposite files
  49.     set %u
  50.     while [ -n "$1" ]; do
  51.       cat $1 >>%D/$1 || echo tag $1 >>$MC_CONTROL_FILE
  52.       shift
  53.     done
  54.  
  55. + t r & ! t t
  56. d       Delete file if a copy exists in the other directory.
  57.     if [ "%d" = "%D" ]; then
  58.       echo "The two directores must be different"
  59.       exit 1
  60.     fi
  61.       if [ -f %D/%f ]; then        # if two of them, then
  62.           if cmp -s %D/%f %f; then
  63.             rm %f && echo %f: DELETED
  64.           else
  65.             echo "%f and %D/%f differ: NOT deleted"
  66.             echo -n "Press RETURN "
  67.             read key
  68.           fi
  69.     else
  70.       echo %f: No copy in %D/%f: NOT deleted.
  71.         fi
  72.  
  73. + t t
  74. D       Delete tagged files if a copy exists in the other directory.
  75.     if [ "%d" = "%D" ]; then
  76.       echo "The two directores must be different"
  77.       exit 1
  78.     fi 
  79.         for i in %t
  80.         do 
  81.           if [ -f %D/$i ]; then
  82.             SUM1="`sum $i`"
  83.             SUM2="`sum %D/$i`"
  84.             if [ "$SUM1" = "$SUM2" ]; then
  85.           rm $i && echo ${i}: DELETED
  86.         else
  87.           echo $i and %D/$i differ: NOT deleted.
  88.         fi
  89.       else
  90.         echo %f has no copy in %D/%f: NOT deleted.
  91.           fi
  92.         done
  93.  
  94. = f \.gz$ & t r
  95. + ! t t
  96. n       Inspect gzip'ed newsbatch file
  97.         dd if=%f bs=1 skip=12|zcat|${PAGER-more}
  98.         # assuming the cunbatch header is 12 bytes long.
  99.  
  100. = t r &
  101. + ! t t
  102. h       Strip headers from current newsarticle
  103.     CHECK=`sed 1q < %f|awk '{print $1}'` 2>/dev/null
  104.     case $CHECK in
  105.       Newsgroups:|Path:)
  106.           cp %f /tmp/%f.$$ && sed '/^'"$CHECK"' /,/^$/d' /tmp/%f.$$ > %f
  107.               [ "$?" = "0" ] && rm /tmp/%f.$$
  108.           echo %f: header removed
  109.         ;;
  110.       *)
  111.           echo %f is not a news article.
  112.         ;;
  113.     esac
  114.  
  115. + t t
  116. H       Strip headers from the marked newsarticles
  117.     set %u
  118.     while [ -n "$1" ]; do
  119.       CHECK=`sed 1q < $1|awk '{print $1}'` 2>/dev/null
  120.       WFILE=/tmp/${1}.$$
  121.       case $CHECK in
  122.         Newsgroups:|Path:)
  123.           cp $1 $WFILE && sed '/^'"$CHECK"' /,/^$/d' $WFILE > $1
  124.               if [ "$?" = "0" ]; then
  125.         rm $WFILE; echo $1 header removed. OK.
  126.           else
  127.             echo tag $1 >>$MC_CONTROL_FILE
  128.         echo "Oops! Please check $1 against $WFILE"
  129.           fi
  130.         ;;
  131.         *)
  132.           echo $1 skipped: Not a news article.
  133.           echo tag $1 >>$MC_CONTROL_FILE
  134.         ;;
  135.       esac
  136.       shift
  137.     done
  138.  
  139. = t r
  140. + ! t t
  141. r       Copy file to remote host
  142.     echo -n "To which host?: "
  143.         read Host
  144.         echo -n "To which directory on $Host?: "
  145.         read Dir
  146.         rcp -p %f ${Host}:$Dir
  147.  
  148. + t t
  149. R       Copy files to remote host (no error checking)
  150.     echo -n "Copy files to which host?: "
  151.         read Host
  152.         echo -n "To which directory on $Host? :"
  153.         read Dir
  154.         rcp -pr %u ${Host}:$Dir
  155.  
  156. = f \.tex$ & t r
  157. + f \.tex$ & t r & ! t t
  158. t       Run latex on file and show it with xdvi
  159.         latex %f && xdvi `basename %f .tex`.dvi
  160.  
  161. =+ f ^part | f ^Part | f uue & t r
  162. + t t
  163. U       Uudecode marked news articles (needs work)
  164.     set %u
  165.         (
  166.     while [ -n "$1" ]; do # strip headers
  167.           FIRST=`sed 1q < $1|awk '{print $1}'`
  168.       cat $1 | sed '/^'"$FIRST"' /,/^$/d'; shift
  169.     done
  170.     ) |sed '/^$/d' |sed -n '/^begin 6/,/^end$/p' | uudecode
  171.     if [ "$?" != "0" ]; then
  172.       echo "Could not decode %t"
  173.       for i in %t; do
  174.         echo tag $i >>$MC_CONTROL_FILE
  175.         shift
  176.       done
  177.     fi
  178.     echo "Please test the output file before deleting anything"
  179.  
  180. =+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.Z$ & t r
  181. x       Extract the contents of a compressed tar file
  182.     tar xzvf %f
  183.  
  184. = t r
  185. + ! t t
  186. y       Gzip or gunzip current file
  187.         unset DECOMP
  188.     echo %f|egrep -q "\.gz$|\.z$|\.Z$" && DECOMP=-d
  189.         gzip $DECOMP -v %f
  190.  
  191. + t t
  192. Y       Gzip or gunzip tagged files
  193.         for i in %t
  194.         do
  195.           unset DECOMP
  196.       echo $i|egrep -q "\.gz$|\.z$|\.Z$" && DECOMP=-d
  197.           gzip $DECOMP -v $i
  198.         done
  199.  
  200. + f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ & t r & ! t t
  201. z       Extract compressed tar file to subdirectory
  202.         unset D
  203.     echo %f|egrep -q "\.tar.gz$" && EXT=tar_gz
  204.     echo %f|egrep -q "\.tgz$"    && EXT=tgz
  205.     echo %f|egrep -q "\.tpz$"    && EXT=tpz
  206.     echo %f|egrep -q "\.tar.Z$"    && EXT=tar_Z
  207.     echo %f|egrep -q "\.tar.z$"    && EXT=tar_z
  208.         case $EXT in
  209.           tar_gz) D="`basename %f .tar.gz`";;
  210.           tgz)    D="`basename %f .tgz`";;
  211.           tpz)    D="`basename %f .tpz`";;
  212.           tar_Z)  D="`basename %f .tar.Z`";;
  213.           tar_z)  D="`basename %f .tar.z`";;
  214.         esac
  215.         mkdir $D; cd $D && tar xvzof ../%f
  216.  
  217. + t t
  218. Z       Extract compressed tar files to subdirectories
  219.     set %u
  220.     while [ -n "$1" ]
  221.         do
  222.           unset D
  223.       echo $1|egrep -q "\.tar.gz$" && EXT=tar_gz
  224.       echo $1|egrep -q "\.tgz$"    && EXT=tgz
  225.       echo $1|egrep -q "\.tpz$"    && EXT=tpz
  226.       echo $1|egrep -q "\.tar.Z$"    && EXT=tar_Z
  227.       echo $1|egrep -q "\.tar.z$"    && EXT=tar_z
  228.           case $EXT in
  229.             tar_gz) D="`basename $1 .tar.gz`";;
  230.             tgz)    D="`basename $1 .tgz`";;
  231.             tpz)    D="`basename $1 .tpz`";;
  232.             tar_Z)  D="`basename $1 .tar.Z`";;
  233.             tar_z)  D="`basename $1 .tar.z`";;
  234.           esac
  235.           mkdir $D; (cd $D && tar xvzof ../$1)||echo tag $1 >>$MC_CONTROL_FILE
  236.       shift
  237.         done
  238.