# Is this idiomatic Crystal or is there a simpler way to run a process while monitoring its output?

**URL:** <https://forum.crystal-lang.org/t/is-this-idiomatic-crystal-or-is-there-a-simpler-way-to-run-a-process-while-monitoring-its-output/5330>\
**Category:** Help & Support\
**Created:** [February 5, 2023, 4:37pm UTC](https://forum.crystal-lang.org/t/is-this-idiomatic-crystal-or-is-there-a-simpler-way-to-run-a-process-while-monitoring-its-output/5330 "2023-02-05T16:37:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![serge-hulne](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/serge-hulne/32/1211_2.png) [@serge-hulne](https://forum.crystal-lang.org/u/serge-hulne)\
**Post date:** [February 5, 2023, 4:37pm UTC](https://forum.crystal-lang.org/t/is-this-idiomatic-crystal-or-is-there-a-simpler-way-to-run-a-process-while-monitoring-its-output/5330/1 "2023-02-05T16:37:40Z")

</div>

```auto
def run(pr : String)
    commands = pr.split(" ")
    pr = commands[0]
    proc = Process.find_executable(pr)
    opts = args=commands[1, commands.size]
    Process.run("#{proc}", opts, output: :inherit)
end

run("ls -lAF")

```

---

<div class="post-metadata">

**Author:** ![npn](https://avatars.discourse-cdn.com/v4/letter/n/e68b1a/32.png) [@npn](https://forum.crystal-lang.org/u/npn)\
**Post date:** [February 5, 2023, 4:46pm UTC](https://forum.crystal-lang.org/t/is-this-idiomatic-crystal-or-is-there-a-simpler-way-to-run-a-process-while-monitoring-its-output/5330/2 "2023-02-05T16:46:22Z")

</div>

just use `Process.run(command, shell: true, output: :inherit)`?

---

<div class="post-metadata">

**Author:** ![serge-hulne](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/serge-hulne/32/1211_2.png) [@serge-hulne](https://forum.crystal-lang.org/u/serge-hulne)\
**Post date:** [February 5, 2023, 4:48pm UTC](https://forum.crystal-lang.org/t/is-this-idiomatic-crystal-or-is-there-a-simpler-way-to-run-a-process-while-monitoring-its-output/5330/3 "2023-02-05T16:48:43Z")

</div>

Thank you!
