Shell Commands/Setenv

From MorphOS Library

Revision as of 13:15, 3 March 2015 by JPV (talk | contribs) (Created page with "'''SetEnv''' - Creates or modifies specified global environment variable NAME, SAVE/S, STRING/F <nowiki> NAME - Name of the variable to create or modify...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

< Shell Commands

SetEnv - Creates or modifies specified global environment variable

NAME, SAVE/S, STRING/F

NAME   - Name of the variable to create or modify                              
SAVE   - Variable will be available after a reboot
STRING - String to attach to the variable

Environment variables are called by scripts or other commands by including a dollar sign ($) in front of the variable name. To remove a global variable definition, use the UnSetEnv command.

Example:

  MorphOS:> SetEnv MOS "MorphOS RULEZ !"
  MorphOS:> Echo "$MOS"
  MorphOS Rulez !

NOTE: Use SetEnv without arguments to display a list of current global variables.

NOTE2: If a global and a local variable share the same name, the local variable is used.