TrySystem()
TrySystem(command
)
System()
, it executes a command on the shell
(sh
or its equivalents), but always returns 0. In
contrast, System()
returns -1 on
error.SYSTEMSTATUS
to
SUCCESS
, FAILURE
or APPERROR
(command was run but returned an exit code other than 0).exten => 123,1,TrySystem(echo 'Hey World' > /tmp/hey.txt)
-= Info about application 'TrySystem' =- [Synopsis] Try executing a system command [Description] TrySystem(command): Executes a command by using system(). on any situation. Result of execution is returned in the SYSTEMSTATUS channel variable: FAILURE Could not execute the specified command SUCCESS Specified command successfully executed APPERROR Specified command successfully executed, but returned error code Old behaviour: If the command itself executes but is in error, and if there exists a priority n + 101, where 'n' is the priority of the current instance, then the channel will be setup to continue at that priority level. Otherwise, System will terminate.
- none -
System()
”