Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

SETENV Internal
Purpose: Sets the value of a global variable.
Format: SETENV [<name>] [<string>]
Template: NAME, STRING/F
Path: Internal
SETENV with no arguments lists the current global environment variables.

SETENV with <name> and <string> arguments creates a new global environment variable. The first word after SETENV is taken as the <name>, argument, while everything else on the command line after that is taken as the <string> argument. Quotation marks are not required. If you issue a second SETENV command for the same global environment variable name, the previous value is simply overwritten.

Global environment variables are stored in ENV: and are recognised by all Shells. However, if a local environment variable name (defined by SET) and a global environment variable are the same name, the value of the local environment variable is used.

You can access global environment variables in a script or on a command line by placing a dollar sign ($) in front of the variable name.

To remove a global environment variable, use the UNSETENV command.

Example 1:

lists all of the current global environment variables.

Example 2:

3.OS4:> SETENV Editor SYS:Tools/MEmacs creates the global environment variable 'Editor' that can be used with the MORE utility. This specifies the editor as MEmacs, located in the Tools drawer of the System disk. The variable Editor is available from any Shell.

Example 3:

3.OS4:> SETENV Editor C:ED
this is the same as the previous example except that the editor specified is ED. 3.OS4:> ECHO $Editor


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.

Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.