Sometimes, it may be useful to know which operating system is running your script, because there are some differences in operating systems.

The PARSE SOURCE keywords parse information about the operating system. The first word is the name of the operating system. Different interpreters may display different names for operating systems. Here is a chart of typical names:

Name Operating System
WIN32All versions of Microsoft Windows.
UNIXAll versions of UNIX (including LINUX).
DOSAll versions of Microsoft MS-DOS.
MACOSAll versions of Apple's Macintosh.
OS2All versions of IBM OS/2.
WIN32All versions of Windows.
VMSAll versions of VMS.
AMIGAAll versions of Commodore's Amiga system.

/* Get the first word (operating system name) into the
 * variable "OS". Note the trailing dot on this
 * instruction. This is very important, as it throws
 * away any subsequent information that PARSE SOURCE
 * may return.
 */
PARSE SOURCE OS .

/* Display the operating system name */
SAY "Operating system:" OS
Reginald's OPTIONS "OS" statement allows a more specific name to be returned for the operating system. For example, instead of returning the name "WIN32" for all versions of Windows, PARSE SOURCE will return one of the following names:

Name Operating System
WIN95Windows 95.
WIN98Windows 98 (or 98 SE).
WINMEWindows Millenium Edition.
WINNTWindows NT.
WIN2KWindows 2000.
WINXPWindows XP (or later versions).
WIN32SWindows 3.1 or WfW.
WIN32Unknown version of Windows.

/* Enable Reginald's OPTION to return a more specific name */
OPTIONS "OS"
PARSE SOURCE OS .
SAY "Operating system:" OS
Note: To get other information about the operating system, see System Information.