system()
Executes a system command and returns the command exit status. The argument passes directly to the command interpreter. This function works on both UNIX and PC systems, but the execution and results of the command may be different.
| Note When you specify a path and command on the PC, the path can not contain spaces or the asterisk (*) or tilde (~) path completion characters. To workaround this limitation, add the path to your Path system variable. To set your Path variable, select Start > Settings (Windows 2000 only) > Control Panel > System > Advanced > Environment Variables . |
Syntax:
system(command[,mapStdErr,invokeDir,retValue]);
where
command is a system command. It can be a quoted string.
mapStdErr is an optional Boolean parameter (TRUE or FALSE). Specifies mapping stderr.
invokeDir is an optional string parameter. Specifies in which directory to invoke the command.
retValue is an optional Boolean parameter (TRUE or FALSE). Specifies whether to return the value of, and to specify to wait for, the command to finish before continuing AEL. If this is not passed or is FALSE, the return value is the program handle used by AEL, not useful to users.
| Note You cannot use redirect or pipes in command. Using a redirection or pipe causes an error. |
Example:
system("mv abc.dsn def.dsn"); // invokes the mv system command // with the parameters abc.dsn and def.dsn
You can obtain a return value from a command executed in system() and AEL will not continue until the command has been completed.
The value returned is sent to stdout. If you are running a shell script and have an exit code, that exit code is not what is returned. Therefore, you must output to stdout any information you want returned to AEL.
Example:
This example sets "a" to a string representing a "ls" of the current directory.
decl a = system("ls",FALSE,"",TRUE);
Example:
This example sets "a" to a string representing a "ls" of /users/kla/pde directory.
decl a = system("ls",FALSE,"/users/kla/pde",TRUE);
Running Shell Scripts
Suppose xxx.ksh:
#! /bin/ksh ls > tmp cat tmp exit 1
In Unix:
decl a = system("xxx.ksh", FALSE, "", TRUE); decl a = system("ksh xxx.ksh", FALSE, "", TRUE);
Both lines return "ls" of current directory (because of cat command sending the contents of tmp to stdout).
In PC:
decl a = system("ksh xxx.ksh", FALSE, "", TRUE);
Same results. However, not that "ksh" must be placed in front of the shell script name.
Download Example File:
The following link(s) lead to the Agilent EEsof EDA Knowledge center website. You will need to register at this site with a valid support contract to download an example file.
Get File Permissions
Get File Size
Get File Time Stamp
Where Used:
Measurement Expressions (Data Display equations and Schematic MeasEqns), Schematic, Layout, Simulation, GUI
Privacy
Statement
|
Terms of Use
|
Legal |
Contact Us
|
© Agilent 2000-2008 ![]()