next up previous contents index
Next: Execute ( -e) actions Up: Further control Previous: Random number generators   Contents   Index


Special file names

Certain special file names are allowed in gstat. They enable filtering, appending to files, using standard input or output streams and command output substitution. (They will not have this effect for PCRaster file names.)

'> file'
If file exists, then append the output to file (if it is an output file) instead of starting with a fresh file

'| file'
Open file as a pipe, either for reading or for writing

'-'
Use, instead of a disk file, for a reading process the stream stdin, or for a writing process the file stdout

`cmd`
execute the shell command cmd and substitute its output for the file name

Using pipes is at the user's responsibility. Blindly executing command files that contain file names with pipes to harmful commands may result in damage (loss of files for instance). This also applies to the setting of the gnuplot command(s), see section 4.4. Potential damage from such situations is considered as ``consumers risk'', it is comparable to renaming harmful programs to often-used commands.

For safety reasons, the variable secure can be set to 1, which prohibits gstat from system calls, creating pipes or deleting temporary files. Unlike other variables, once secure is set, it cannot be set back (indeed, for security).

As an example of using a pipe as file name, the first variable in example 12 containing the data selection from zinc_map.eas with a zero in column 5, could have been defined directly in terms of zinc_map.eas as

data(zinc.at.0):
"| awk '{if(NR<11||$5==0){print $0}}' zinc_map.eas",
 x=1, y=2, v=3, log, min = 20, max = 40, radius = 1000;

provided that the awk program is available.


next up previous contents index
Next: Execute ( -e) actions Up: Further control Previous: Random number generators   Contents   Index
Edzer Pebesma
1999-08-31