11 lines
251 B
Nim
11 lines
251 B
Nim
|
import osproc
|
||
|
|
||
|
proc runCommand(cmd: string) =
|
||
|
let (output, exitCode) = execCmdEx(cmd)
|
||
|
echo "Command:", cmd
|
||
|
echo "Output:", output
|
||
|
echo "Exit code:", exitCode
|
||
|
|
||
|
runCommand("echo Hello")
|
||
|
runCommand("ls -l")
|
||
|
runCommand("invalid command")
|