Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

gmt_functions.sh 961 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  1. #
  2. # Copyright (c) 1991-2021 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
  3. # See LICENSE.TXT file for copying and redistribution conditions.
  4. #
  5. # This script creates a function for each GMT module which calls the module
  6. # via the main GMT executable (gmt <module>).
  7. #
  8. # Include this file in your GMT bash script or on the command line with:
  9. # source $(gmt --show-sharedir)/tools/gmt_functions.sh
  10. # If the GMT executable is not in the search path, set an extra function:
  11. # function gmt () { path/to/gmt "$@"; }
  12. # export -f gmt
  13. # check for bash
  14. [ -z "$BASH_VERSION" ] && return
  15. if ! [ -x "$(command -v gmt)" ]; then
  16. echo 'Error: gmt is not found in your search PATH.' >&2
  17. exit 1
  18. fi
  19. gmt_modules=$(gmt --show-classic)
  20. compat_modules="minmax gmtstitch gmtdp grdreformat ps2raster originator"
  21. for module in ${gmt_modules} ${compat_modules}; do
  22. eval "function ${module} () { gmt ${module} \"\$@\"; }"
  23. eval "export -f ${module}"
  24. done
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...