Shell Commands/Setenv

From MorphOS Library

< Shell Commands

SetEnv - Creates or modifies specified global environment variable


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.


  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.