September 2013
Intermediate to advanced
548 pages
12h 25m
English
Suppose we want to call a shell script from Erlang. To do this,
we can use the library function os:cmd(Str). This runs
the command in the string Str and captures the result.
Here’s an example using the ifconfig command:
| | 1> os:cmd("ifconfig"). |
| | "lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384\n\t... |
The result will need parsing to extract the information we are interested in.
Read now
Unlock full access