grass-run.src 904 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. # script to launch GRASS commands
  3. # change console title to name of module
  4. if [ "$TERM" = "xterm" ] && [ -n "$BASH" ] ; then
  5. TITLE="GRASS: $1"
  6. echo -e "\033]0;${TITLE}\007\c"
  7. fi
  8. # force command line startup mode
  9. GRASS_UI_TERM=1
  10. export GRASS_UI_TERM
  11. # workaround for systems with xterm is setuid/setgid
  12. # http://grass.itc.it/pipermail/grass5/2004-September/015409.html
  13. LD_LIBRARY_PATH_VAR=$GRASS_LD_LIBRARY_PATH
  14. export LD_LIBRARY_PATH_VAR
  15. echo
  16. echo "================================================================="
  17. echo "If you wish to resize the X monitor, do so now. Window size is"
  18. echo "locked while interactive modules are running."
  19. echo "================================================================="
  20. echo
  21. # run command
  22. "$@"
  23. EXIT_VAL=$?
  24. if [ $EXIT_VAL -ne 0 ] ; then
  25. echo
  26. echo "ERROR: $1 exited abnormally. Press <enter> to continue."
  27. read
  28. fi
  29. exit $EXIT_VAL