fork download
  1. import json
  2. import sys
  3. from subprocess import check_call
  4.  
  5. # script_text = json.load(sys.stdin)
  6. data = sys.stdin.read()
  7. json_text = data.decode("utf-8")
  8. script_text = json.loads(json_text)["script"]
  9. check_call(script_text, shell=True)
Success #stdin #stdout 0.04s 9456KB
stdin
{
  "script": "#!/bin/bash\nprintf \"Hello\\n world 1\""
}
stdout
Hello
 world 1