Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
Note that the additional command-line argument  -slog tells Metview to provide more output - this can be useful to diagnose problems. This argument (and indeed all other arguments) must come before the -b, and anything after it will be interpreted as an argument to your macro.

Getting Environment Variables

Environment variables can be queried, not only in batch mode but also in interactive mode. This can be an alternative way to pass information to a macro.

From a command line, inspect the current environment variables with:

Code Block
languagebash
env | sort

and choose one, for example HOST, which provides the name of the machine you are working on. In a macro, get the value of this variable using the getenv() function. For example:

Code Block
languagepy
machine = getenv('HOST')
print('Running on ', machine)

 

Detecting Whether Metview is Running in Batch Mode

...