mtt_version 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #! /bin/sh
  2. ######################################
  3. ##### Model Transformation Tools #####
  4. ######################################
  5. # Bourne shell script: mtt_version
  6. # Prints out version of a GNU-style tool
  7. # P.J.Gawthrop May 1998
  8. # Copyright (c) P.J.Gawthrop 1998
  9. ###############################################################
  10. ## Version control history
  11. ###############################################################
  12. ## $Id$
  13. ## $Log$
  14. ## Revision 1.3 1999/12/20 02:08:38 peterg
  15. ## Added second arg option
  16. ##
  17. ## Revision 1.2 1998/05/28 09:31:44 peterg
  18. ## Cosmetic changes
  19. ##
  20. ## Revision 1.1 1998/05/28 09:31:13 peterg
  21. ## Initial revision
  22. ##
  23. ###############################################################
  24. if [ -z "$2" ]; then
  25. echo Trying $1 ...
  26. ver=`$1 --version | head -1`
  27. if [ -n "$ver" ]; then
  28. echo is OK and has version $ver.
  29. else
  30. echo Either $1 does not exist or is not the GNU version.
  31. fi
  32. else
  33. echo $1: $2
  34. fi