Launch and executable file inside an Erlang Program
Salvador Alcaraz
salcaraz@REDACTED
Sun Jul 1 11:48:20 CEST 2001
I think that Daniel Neri is right:
"...apparently os:cmd/1 still has problems with
binary output (on Unix)".
because, what does happen if execute an application with E/S display
instructions??
For example:
1> os:cmd("pine").
Thank you in advance
salva
On Sat, 30 Jun 2001, Vance Shipley wrote:
> > I need that the command/application opens a new shell, execute its
> > instrucctions and when finish, it close the shell and return to Erlang
> > program.
>
> Which is exactly what os:cmd/1 does. From the Kernel Refernce Manual
> in the section on the os module:
> ------------------------------------------------------------------------
> cmd(Command) -> string()
>
> Types:
> Command = string() | atom()
>
> Executes Command in a command shell of the target OS and returns
> the result as a string.
> ------------------------------------------------------------------------
>
> The emulator will spawn an operating system shell in a new process and
> feed it the commands you gave it:
>
> 1> os:cmd("pwd; times; echo $SHELL").
> "/export/home/vances\n0m0s 0m0s\n/bin/ksh\n"
>
> -Vance
>
> Vance Shipley
> Motivity Telecom Inc.
> +1 519 579 5816
>
More information about the erlang-questions
mailing list