You can use the pipe-from function or the w/pipe-from macro:
(w/pipe-from x "ls -l"
(readlines x))
That will collect the output from the command "ls -l" and return it as a list of strings. Since it's a normal output port, you can use any of the standard stuff on it, like readc, readline, etc. I chose to use readlines because I use that the most often when dealing with scripts.
---
If you only want to call a script, and don't care about it's output, you can use system:
(system "ls -l")
And if you want to collect the output into one giant string, you can combine it with tostring:
(tostring:system "ls -l")
This returns a single giant string, rather than a list of strings, as in the pipe-from example. Using pipe-from is a bit more verbose, but gives you more power and control, so I prefer it rather than system.
It would appear readlines is also specific to my copy of Arc, so here it is as well:
(def readlines (x)
(drain:readline x))
I have included lots of useful stuff like that in my fork of Arc... And here is an obvious shortened version, for the common case of getting the output as a list of strings:
(def pipe-lines (y)
(w/pipe-from x y readlines.x))