1

In mruby how can I run shell commands with %x(), `` or system? Is there an mgem I can use for it?

1 Answers1

1

Try mruby-io which implementes popen: https://github.com/iij/mruby-io/blob/728d313b2c238ac0f41a4aa7e4a88e6a8fee8079/mrblib/kernel.rb#L2-L4

Or type mruby-process which implements system: https://github.com/iij/mruby-process/blob/c31010dc0440335a7693fd70ae005c79bd1378ec/src/process.c#L368

  • I found the `system` in mruby-process but it doesn't return anything from the process. I actually implemented a version of the backtick operator, and got a simple version working but it makes a lot more sense to use mruby-io instead. – Filipe Correia Aug 21 '17 at 13:29