Spawning processes on host OS with unix:cmd/1

Rick Pettit <>
Fri Dec 7 21:38:56 CET 2001


> Rick Pettit <> wrote:
> >
> >Is there a way to start a UNIX process from Erlang and get the pid?
> 
> I assume you don't want to interact with the program through a port
> (otherwise unix:cmd() is not the way to go), but just get it running
> independent from the Erlang system? Try this if so:
> 
>   unix:cmd("/your/program & echo $!")
> 
> (Nothing Erlang-specific really...:-)

How very simple :-).  Can't believe I didn't see that possibility
earlier.  Oh, and by the way, I now use os:cmd/1 as it appears unix:cmd/1
is deprecated.

Thanks for your help.

Rick




More information about the erlang-questions mailing list