lua popen()控制台输出html

时间:2014-05-16 20:56:24

标签: lua

我遇到简单脚本问题:

<%- 
local f = io.popen("/sbin/mtd wl0 constatus") -- runs command
local l = f:read("*a") -- read output of command
print(l)
f:close()
-%>

它执行命令并在html文件中打印输出。问题是输出应该是这样的:

Connection Status
=============================
Noise Level      -256 dBm
Channel Load        1 %
Disconnections        0

 MAC address       | RSSI dBm       | PHY Rate Mb/s | Type   | Tx packets  | Tx dropped  | Rx packets

但默认情况下是一行,没有行,使用<textarea>我已经达到了所需的输出格式,但<textarea>行应该是我需要的动态(新行=新连接的设备)但不幸的是不是

如何在控制台或带有动态行/高度的textarea中显示控制台输出的格式?

0 个答案:

没有答案
相关问题