lua-users home
lua-l archive

Re: Returning result from execute function.

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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.

AltStyle によって変換されたページ (->オリジナル) /