# Make system.util.execute return stdout and stderr

**URL:** <https://forum.inductiveautomation.com/t/make-system-util-execute-return-stdout-and-stderr/4042>\
**Category:** Ignition\
**Created:** [February 22, 2012, 5:14pm UTC](https://forum.inductiveautomation.com/t/make-system-util-execute-return-stdout-and-stderr/4042 "2012-02-22T17:14:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [February 22, 2012, 5:14pm UTC](https://forum.inductiveautomation.com/t/make-system-util-execute-return-stdout-and-stderr/4042/1 "2012-02-22T17:14:40Z")

</div>

This would be pretty useful if we could run some process and get the stdout.

Example usage:

```auto
CONST_HOST_START = "Pinging "
CONST_HOST_END = " with 32 bytes of data:"
CONST_SUCCESS = "Reply from "

(output, error) = system.util.exec(["ping", "192.168.1.1", "-n 1"])
host = "???"
isonline = "???"

# find target ip
start = output.find(CONST_HOST_START) + len(CONST_HOST_START)
end = output.find(CONST_HOST_END)
host = output[start:end]

#find state
if output.find("Reply from ") == -1:
	isonline = 0
else:
	isonline = 1

print host, result
```
