[erlang-questions] Running multiple commands like os:cmd/1

Kevin Montuori <>
Thu Dec 27 20:14:46 CET 2012



On Thu, Dec 27, 2012, at 8:03, Gleb Peregud wrote:

> At the moment solution 99.99% solution in the previous email works for
> me. I have a feeling that a proper solution would have to reimplement
> large part of the /bin/sh to make it really robust.

Although it doesn't answer the question you asked exactly, I'd suggest
that when you get to this point you're fighting a little against the
grain of the language.  Sometimes it's easier to whomp up a shell (or
Perl, Python, &c.) script and just call that instead of trying to figure
out how to robustly string together individual shell commands.  It often
ends up being easier to test and debug because you've separated the
tasks of calling the shell script from the actions the shell script
performs.  Plus you can maintain shell script changes separately from
the Erlang wrapper.

I don't presume to understand the issue you're trying to solve and it
seems like you have things well in hand, so please take my observation
with a grain of salt.

k.

-- 
  Kevin Montuori
  



More information about the erlang-questions mailing list