nim-lib/tests/test_execCmd.nim

11 lines
251 B
Nim
Raw Normal View History

2023-03-08 16:56:26 -05:00
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")