Sysexec – Visara Master Console Center Scripting Guide User Manual
Page 198
![background image](https://www.manualsdir.com/files/808700/content/doc198.png)
Chapter 5 Script Commands
Scripting Guide
198
SYSEXEC
Syntax:
SYSEXEC( $String) ==> %Return
Description:
Executes a Unix command on the MCC host system with parameters.
Action:
The string is executed as a system command by passing it to the Unix
system. Script execution waits until the system command completes
execution and gives a return value.
Parameters:
$String. String expression. The system command and any parameters.
Returns:
Numeric Value. %Return. The exit value of the executed command, as
follows:
Return Code
Meaning
0 Success
-1
Permission
Denied
2 Syntax
Error
127
Not
Found
If the command is successful, the return code is the same value as a
shell script would return for the same command. The value is obtained
from the Unix command line program.
Notes:
1. SYSEXEC can be used to play a sound file on an X-term, if the X-
term has a sound card installed and the appropriate software is
installed on the MCC server. To determine the name of an X-term,
compare its IP address to the entries in /etc/hosts. Refer to the
second example below.
2. Any program, such as a Unix shell script, started from the
SYSEXEC command must be stopped in the reserved script
#SHUTDN.SCR. If it is stopped in any other way, restarting the
MCC may result in multiple copies of the same script, causing
unexpected results.
Example:
//This example creates a file named /usr/home/ics/files
//from the contents of the directory /usr/isc/script
$Command := “ls –1 /usr/ics/script > /usr/home/ics/files”
%Return := SYSEXEC($Command)
//This example plays the sound ‘godzilla.au’ on the X-
term
//named todds_x-term. The command is broken into 4
//strings for readability.
$Command := “/usr/tekxp/bin/AlphaAXP_OSF1/xpsh -display ”
$Target := “todds_x-term”
$Flags := “:0.0 aplay -p -a NFS -f “
$Soundfile := “/usr/ics/audio/godzilla.au”
%Return := SYSEXEC($Command + $Target + $Flags + $Soundfile)
See Also:
N/A