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

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

SET with <name> and <string> arguments creates a new local environment variable. The first word after SET 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 SET command for the same local environment variable name, the previous value is simply overwritten.

An local environment variable created with SET is local to the Shell in which it was created. If you create a new Shell with the NEWSHELL command, that Shell also recognises any variables created in its parent Shell. However if you open an additional Shell by opening the Shell icon or by using the 'Execute Command' menu item, local environment variables created with SET are not recognised in the new Shells.

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

To remove a local environment variable, use the UNSET command.

Example 1:

3.OS4:> SET
Process       3
RC            5
Result2       205
_mchar        ||
_pchar        |
_Runtime      0.001751
_ShellVersion 51.39
lists all of the current local environment variables.

Example 2:

3.OS4:> SET Origin This process launched from an icon
creates the local environment variable 'Origin' that stores a reminder that a Shell was invoked from an icon rather than a NEWSHELL. 3.OS4:> ECHO $Origin
This process launched from an icon


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.