Logo

Programming-Idioms

  • Haskell
  • Lisp

Idiom #111 Launch other program

From current process, run program x with command-line parameters "a", "b".

(sb-ext:run-program '("a" "b") "/path/to/x")

SBCL only
import System.Process
spawnProcess x ["a","b"]

Assuming that x is a filepath to the program to run.
#include <stdlib.h>
int system("x a b");

This spawns a shell and returns, when the child process has exited.

New implementation...
< >
programming-idioms.org