Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 4 out of 5     Rate this Document

Can I Set an Environment Variable from MATRIXx Using the Oscmd Command?

Primary Software: MATRIXx
Primary Software Version: 6.2
Primary Software Fixed Version: N/A
Secondary Software:

Problem: I want to change an environment variable from with in MATRIXx. Can I use the oscmd to change an environment variable?

Solution: The oscmd command can not be used to change an environment variable, since changes made to variables using the oscmd command are seen in a separate shell from Xmath.

When an environment variable is created or changed, only the current shell is affected. Other shells that are already open, will not see the change. When a shell is spawned from another shell, the environment variables of the parent shell are imported to the child shell. After that, the relationship is severed and changes in one shell will not be seen in the other.

The oscmd command is run in a new shell spawned by the Xmath shell. You can thus see all of the environment variables currently set in Xmath, and change them within the shell that has been spawned by oscmd. However the changes will not be seen in the Xmath shell. Environment variables can not be changed from within Xmath once Xmath is running. All environmental variables should be set before Xmath is called.

Related Links:

Attachments:





Report Date: 02/11/2003
Last Updated: 04/17/2003
Document ID: 2UAFM6OH

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit