AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   execute linux commands? (https://forums.alliedmods.net/showthread.php?t=12643)

wgitscht 04-20-2005 07:30

execute linux commands?
 
is it possible to call unix / linux commands, as it is with e.g. c/c++/php and its exec() function?
i would really love to pipe some info to a running linux application and i would need something like this call_linux_func(" echo 'ddd' | linuxcommand -takes -some -paras ") it would be enough to just call the linux function though.

XxAvalanchexX 04-20-2005 13:53

Code:

static cell AMX_NATIVE_CALL system_cmd(AMX *amx, cell *params)
{
    int len;
    char *cmd = MF_GetAmxString(amx, params[1], 0, &len);
    system( cmd );

  return 1;
}

From a post Suzuka made. Just slap that into a module and it should work. ;-)

danny0085 04-20-2011 16:01

Re: execute linux commands?
 
Here you can check out the most used linux commands .


All times are GMT -4. The time now is 09:53.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.