I love you.
Is there a Unix version of this? To run OS console commands.
I haven’t really tested it thoroughly, but it should work fine. The function is cmd.exec( str ).
If this works well, you are my new favorite person!
Also, do I just need the “cmd.exec( str )” or all of the lua file OP posted, modified for unix instead of dos? I’m a lua noob.
Example of the use.
[lua]concommmand.Add(“cmd_exec”, function( p, c, a )
cmd.exec(tostring(a)) // a refers to a (forced) string; IE somethimg like “ping google.com”.
If anyone comes here from a google search wondering the same thing I am, with the same skill level I have, this is what you are looking for.
Christaster’s gm_cmd_linux.dll module: gm_cmd_linux.dll
Example lua script “cmd.lua”
require("cmd") function WriteFile() cmd.exec("echo 'test' >> /home/gmod/test.txt") end concommand.Add( "test_com" , WriteFile )
Would someone be so kind as to repost the windows binary? I unfortunately lack the ability to compile the posted source. Thank-you.