home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mm / mm-0.90 / mmversion < prev    next >
Encoding:
Text File  |  1990-12-18  |  1.4 KB  |  48 lines

  1. #!/bin/sh
  2. #
  3. # Copyright (c) 1986, 1990 by The Trustees of Columbia University in
  4. # the City of New York.  Permission is granted to any individual or
  5. # institution to use, copy, or redistribute this software so long as it
  6. # is not sold for profit, provided this copyright notice is retained.
  7. #
  8. #
  9. # $Header: /f/src2/encore.bin/cucca/mm/tarring-it-up/RCS/mmversion,v 2.1 90/10/04 18:32:57 melissa Exp $
  10. #
  11. # A hack to get rcs-id's and version info for mm.  A better way probably,
  12. # exists.  Feel free to let us know.
  13. #
  14. # If no arguments are given, version information is given all of ./mm's 
  15. # modules.
  16. # If one argument is given, version information for all modules of specified
  17. # executable or object file is displayed.
  18. # If two or more arguments are specified, the first argument is a regular
  19. # expression, and the remainder are executables or object files.
  20. #
  21.  
  22. if [ $# = 1 ] && [ "$1" = "-h" ]; then
  23.   echo "usage: $0 [ [ regexp ] executable ]"
  24.   echo "       $0 regexp executable ..."
  25.   exit 0
  26. fi
  27. if [ $# = 0 ]; then
  28.   module=ALL
  29.   prog=mm
  30. elif [ $# = 1 ]; then
  31.   module="ALL"
  32.   prog=$1
  33. else
  34.   module=$1
  35.   shift
  36.   prog=$@
  37. fi
  38.  
  39. if [ "$module" = "ALL" ]; then
  40.   /usr/ucb/strings $prog | egrep '^Columbia|^Compiled|\$Header' |\
  41.     sed -e 's/^\$Header\: //' -e 's/Exp \$$//' | sort 
  42. else
  43.   /usr/ucb/strings $prog | egrep '^Columbia|^Compiled|\$Header' |\
  44.     sed -e 's/^\$Header\: //' -e 's/Exp \$$//' | sort |\
  45.     egrep "^Columbia|^Compiled|$module"
  46. fi
  47.  
  48.