CLI commands from phoenix

Hi all,

I have a bunch of scripts (bash) that I need to expose in the form of a REST API so a remote app can run them and gather the results. I was thinking I could use Phoenix to create the REST interface, that is quite straight forward, but I am not sure if:

  • Can I call bash command from Phoenix? How?
  • Can Phoenix get the result of the bash script ?

This is a secure environment (internal lab server calling the other - isolated = off the Internet) so, I do not really care much about the security aspects of this.

As always, any comment is highly welcome.


You can use System.cmd/3.

1 Like

Excellent! Thank you!