Documentation

Environment Variables

Environment Variables

A number of environment variables available in a tool session.  A few are discussed here.  A full list can be viewed by running the "env" command from a terminal in the workspace tool.

*Note: tools are invoked by the user's account and permissions set accordingly.  A tool can save files to a user's home directory because the tool runs as that user.

SESSION="session id"

This variable stores the session ID or session number that is currently active.  It's the ID of the session you are currently using.

USER="username"

This variable stores the current username of the user running the tool.

SESSIONDIR=/home/"hub hostname"/"username"/data/sessions/"session id"

This variable stores the current session directory of the open tool.  This session directory is a separate directory create for each new tool session that the tool can write to.  This is a good place for temporary files generated by your tool.

*This is the default path for a tool on invoke.

RESULTSDIR=/home/"hub hostname"/"username/data/results/"session id"

This variable stores the results directory located in the user's home directory. This is a good place to place simulation results for the user to access later. 

*Be mindful of the user's quota limits.

PWD=/"present working directory"

This variable stores the present working directory.

HOME=/home/"hub hostname"/"username"

This variable stores the path of the user's home directory.  This is useful if a tool provided an option to save the user's current work. Please create a directory for the tool to save files here, to prevent cluttering the user's home directory too much.   A best practice would be to create a new directory for a tool in the user's data directory.  For example, "$HOME/data/toolname".

Last modified:

  • Copyright © 2022 Hubzero
  • Powered by Hubzero®