eqivalent of "unix" from scilab

16 views
Skip to first unread message

Mariusz Grecki

unread,
Feb 28, 2019, 1:28:52 PM2/28/19
to tumbi
I cannot find an equivalent of "unix" command (which executes the external program). I found something like "spawn" but its usage is not intuitive and I could not find documentation... How to run an external program from nsp script?
Thanks in advance.

Jean-Philippe Chancelier

unread,
Feb 28, 2019, 3:41:37 PM2/28/19
to tu...@googlegroups.com

Hello Mariusz,

The equivalent of unix command is the command system

    system('pwd')

    system('emacs foo.sce');

The command you give is executed by a shell and thus depends on the OS you are using system("pwd") will not work on windows.

The spawn functions are different since they can be used to run an executable and pass arguments to the executable like spawn_sync(['emacs','-rv','foo.txt'])  (emacs must ne in your path).

spwan_sync runs the executable and wait for return from the execution; spawn_async is asynchronous

and spawn can be used to run an executable (for example an interpreter) and interact with the executable

through multiple commands (there's an exemple in tests/transmit.sce).

Regards

jpc



On 2/28/19 7:28 PM, 'Mariusz Grecki' via tumbi wrote:
I cannot find an equivalent of "unix" command (which executes the external program). I found something like "spawn" but its usage is not intuitive and I could not find documentation... How to run an external program from nsp script?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "tumbi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tumbi+un...@googlegroups.com.
To post to this group, send email to tu...@googlegroups.com.
Visit this group at https://groups.google.com/group/tumbi.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages