#!/usr/bin/lua local f = io.popen("/usr/bin/ntpq -c pe") -- runs command local line while true do line = f:read("*l") -- read output of command if line == nil then break end -- print(line) if not string.match(line, "==============================================================================") then local pl = line pl = string.gsub(line, "%s+", " ") pl = string.gsub(pl, "^%s+", "") pl = string.gsub(pl, "%s", "") pl = string.format("%s", pl) print(pl) end end f:close()