Stream: beginners

Topic: ✔ Running a shell command string with Cmd


view this post on Zulip Isaac Van Doren (Oct 12 2024 at 02:27):

Is there a way to run a full command as a single string using Cmd? At first I thought I might be able to do something like this but this does not work

 Cmd.exec! "bash" ["echo hello world"]

view this post on Zulip Brendan Hansknecht (Oct 12 2024 at 02:31):

-c?

view this post on Zulip Brendan Hansknecht (Oct 12 2024 at 02:31):

Cmd.exec! "bash" ["-c", "echo hello world"]

view this post on Zulip Isaac Van Doren (Oct 12 2024 at 02:32):

That's it, thanks!

view this post on Zulip Notification Bot (Oct 12 2024 at 02:32):

Isaac Van Doren has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC