Revisions
-
erikLundstedt revised this gist
Sep 30, 2022 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,21 +7,21 @@ local shell={} function shell.capture(cmd) local handle = assert(io.popen(cmd, 'r')) local output = assert(handle:read('*a')) handle:close() local raw=output output = string.gsub( string.gsub( string.gsub(output, '^%s+', ''), '%s+$', '' ), '[\n\r]+', ' ' ) local o={} o["out"] = output o["raw"] = raw return o end return shell -
erikLundstedt revised this gist
Sep 30, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ function shell.capture(cmd) ' ' ) return {"out" output "raw" raw} end shell -
erikLundstedt revised this gist
Sep 30, 2022 . 1 changed file with 3 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,16 +4,13 @@ local shell={} function shell.capture(cmd) local handle = assert(io.popen(cmd, 'r')) local output = assert(handle:read('*a')) handle:close() local raw=output output = string.gsub( string.gsub( string.gsub(output, '^%s+', ''), @@ -24,7 +21,7 @@ function shell.capture(cmd, raw) ' ' ) return {"out" output "raw" raw) end shell -
erikLundstedt renamed this gist
Sep 30, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
erikLundstedt revised this gist
Sep 30, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ --- -- Function to retrieve console output -- local shell={} function shell.capture(cmd, raw) -
erikLundstedt revised this gist
Sep 30, 2022 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,10 @@ --- -- Function to retrieve console output -- lcoal shell={} function shell.capture(cmd, raw) local handle = assert(io.popen(cmd, 'r')) local output = assert(handle:read('*a')) @@ -22,4 +25,6 @@ function os.capture(cmd, raw) ) return output end shell -
dukeofgaming created this gist
Jun 9, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ --- -- Function to retrieve console output -- function os.capture(cmd, raw) local handle = assert(io.popen(cmd, 'r')) local output = assert(handle:read('*a')) handle:close() if raw then return output end output = string.gsub( string.gsub( string.gsub(output, '^%s+', ''), '%s+$', '' ), '[\n\r]+', ' ' ) return output end