Re: Returning result from execute function.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Returning result from execute function.
- From: Reuben Thomas <rrt@...>
- Date: 2001年11月26日 15:57:44 +0000 (GMT)
> execute("dir > temp_file.txt")
and if you have pipes, you can use something like this:
function shell(c)
local input = _INPUT
local o, h
h = readfrom("| " .. c)
o = read("*a")
closefile(h)
_INPUT = input
return o
end
and then just
shell("dir")
will do what you want.