RosettaCodeData/Task/Get-system-command-output/Genie/get-system-command-output.genie

20 lines
491 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
[indent=4]
/*
Get system command output, in Genie
valac getSystemCommandOutput.gs
./getSystemCommandOutput
*/
init
try
// Blocking with output capture
standard_output : string
standard_error : string
exit_status : int
Process.spawn_command_line_sync("sh -c 'ls getSys*'",
out standard_output, out standard_error, out exit_status)
print standard_output
except e : SpawnError
stderr.printf("%s\n", e.message)