/usr/share/doc/gmt/html/man/gmt_shell_functions.html is in gmt-doc 4.5.12-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | <!-- Creator : groff version 1.22.2 -->
<!-- CreationDate: Thu Feb 27 18:11:53 2014 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title>GMT_SHELL_FUNCTIONS.SH</title>
</head>
<body bgcolor="#ffffff">
<h1 align="center">GMT_SHELL_FUNCTIONS.SH</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#NOTES">NOTES</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<h2>NAME
<a name="NAME"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">gmt_shell_functions.sh
− Practical functions to be used in GMT bourne shell
scripts</p>
<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>gmt_init_tmpdir
<br>
gmt_remove_tmpdir <br>
gmt_clean_up</b> [<i>prefix</i>] <b><br>
gmt_message</b> <i>message</i> <b><br>
gmt_abort</b> <i>message</i> <b><br>
gmt_nrecords</b> <i>file(s)</i> <b><br>
gmt_nfields</b> <i>string</i> <b><br>
gmt_get_field</b> <i>string</i> <b><br>
gmt_get_region</b> <i>file(s)</i> [<i>options</i>] <b><br>
gmt_get_gridregion</b> <i>file</i> [<i>options</i>] <b><br>
gmt_get_map_width −R −J <br>
gmt_get_map_height −R −J <br>
gmt_set_psfile</b> <i>file</i> <b><br>
gmt_set_framename</b> <i>prefix framenumber</i> <b><br>
gmt_set_framenext</b> <i>framenumber</i></p>
<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><i><b>gmt_shell_functions.sh</b></i>
provides a set of functions to Bourne (again) shell scripts
in support of <b><A HREF="GMT.html">GMT</A></b>. The calling shell script should
include the following line, before the functions can be
used:</p>
<p style="margin-left:11%; margin-top: 1em"><b>.
gmt_shell_functions.sh</b></p>
<p style="margin-left:11%; margin-top: 1em">Once included
in a shell script, <b>gmt_shell_functions.sh</b> allows
<b><A HREF="GMT.html">GMT</A></b> users to do some scripting more easily than
otherwise. The functions made available are: <b><br>
gmt_init_tmpdir</b></p>
<p style="margin-left:22%;">Creates a temporary directory
in <b>/tmp</b> or (when defined) in the directory specified
by the environment variable <b>TMPDIR</b>. The name of the
temporary directory is returned as environment variable
<b>GMT_TMPDIR</b>. This function also causes <b><A HREF="GMT.html">GMT</A></b> to
run in ‘isolation mode’, i.e., all temporary
files will be created in <b>GMT_TMPDIR</b> and the
.gmtdefaults file will not be adjusted.</p>
<p style="margin-left:11%;"><b>gmt_remove_tmpdir</b></p>
<p style="margin-left:22%;">Removes the temporary directory
and unsets the <b>GMT_TMPDIR</b> environment variable.</p>
<p style="margin-left:11%;"><b>gmt_cleanup</b></p>
<p style="margin-left:22%;">Remove all files and
directories in which the current process number is part of
the file name. If the optional <i>prefix</i> is given then
we also delete all files and directories that begins with
the given prefix.</p>
<p style="margin-left:11%;"><b>gmt_message</b></p>
<p style="margin-left:22%;">Send a message to standard
error.</p>
<p style="margin-left:11%;"><b>gmt_abort</b></p>
<p style="margin-left:22%;">Send a message to standard
error and exit the shell.</p>
<p style="margin-left:11%;"><b>gmt_nrecords</b></p>
<p style="margin-left:22%;">Returns the total number of
lines in <i>file(s)</i></p>
<p style="margin-left:11%;"><b>gmt_nfields</b></p>
<p style="margin-left:22%;">Returns the number of fields or
words in <i>string</i></p>
<p style="margin-left:11%;"><b>gmt_get_field</b></p>
<p style="margin-left:22%;">Returns the given <i>field</i>
in a <i>string</i>. Must pass <i>string</i> between double
quotes to preserve it as one item.</p>
<p style="margin-left:11%;"><b>gmt_get_region</b></p>
<p style="margin-left:22%;">Returns the region in the form
w/e/s/n based on the data in table <i>file(s)</i>.
Optionally add -I<i>dx</i>/<i>dy</i> to round off the
answer.</p>
<p style="margin-left:11%;"><b>gmt_get_gridregion</b></p>
<p style="margin-left:22%;">Returns the region in the form
w/e/s/n based on the header of a grid <i>file</i>.
Optionally add -I<i>dx</i>/<i>dy</i> to round off the
answer.</p>
<p style="margin-left:11%;"><b>gmt_map_width</b></p>
<p style="margin-left:22%;">Expects the user to give the
desired <b>-R −J</b> settings and returns the map
width in the current measurement unit.</p>
<p style="margin-left:11%;"><b>gmt_map_height</b></p>
<p style="margin-left:22%;">Expects the user to give the
desired <b>-R −J</b> settings and returns the map
height in the current measurement unit.</p>
<p style="margin-left:11%;"><b>gmt_set_psfile</b></p>
<p style="margin-left:22%;">Create the output
<i>PostScript</i> file name based on the base name of a
given file (usually the script name <b>$0</b>).</p>
<p style="margin-left:11%;"><b>gmt_set_framename</b></p>
<p style="margin-left:22%;">Returns a lexically ordered
filename stem (i.e., no extension) given the file prefix and
the current frame number, using a width of 6 for the integer
including leading zeros. Useful when creating animations and
lexically sorted filenames are required.</p>
<p style="margin-left:11%;"><b>gmt_set_framenext</b></p>
<p style="margin-left:22%;">Accepts the current frame
integer counter and returns the next integer counter.</p>
<h2>NOTES
<a name="NOTES"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">1. These
functions only work in the bourne shell (<b>sh</b>) and
their derivatives (like <b>ash</b>, <b>bash</b>, <b>ksh</b>
and <b>zsh</b>). These functions do not work in the C shell
(<b>csh</b>) or their derivatives (like <b>tcsh</b>), and
cannot be used in DOS batch scripts either. <br>
2. <b>gmt_shell_functions.sh</b> were first introduced in
<b><A HREF="GMT.html">GMT</A></b> version 4.2.2 and have since been regularly
expanded with other practical scripting short-cuts. If you
want to suggest other functions, please do so by mailing to
the GMT mailing list: gmt-help@lists.hawaii.edu.</p>
<h2>SEE ALSO
<a name="SEE ALSO"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><i><A HREF="GMT.html">GMT</A></i>(1),
<i>sh</i>(1), <i>bash</i>(1), <i><A HREF="minmax.html">minmax</A></i>(1),
<i><A HREF="grdinfo.html">grdinfo</A></i>(1)</p>
<hr>
</body>
</html>
|