简体   繁体   中英

how should I execute this command properly in C

I am currently using popen to execute a command via C, but it is not coming out properly so I was just wondering If I was doing anything wrong?

the original command (previously called via a bash script but I am now making a C program to call it instead) is

   /home/minecraft/remoteclient01a.py "sendmsgtogroup staff §f(§bSTAFF§f) * $colourcode$MCEXEC_PLAYERNAME§f $MCEXEC_ARGS" 

and the way I am trying to execute it in C is

   snprintf(command, 10000, "/home/minecraft/remoteclient01a.py 'sendmsgtogroup staff  §f(§bSTAFF§f) * %s§f %s'", pname, parg);
   popen(command, "w");

but for someone reason the last variable (parg) does not seem to be included when the command is executed, If someone could let me know if I am messing something up i would really appreciate it, thanks!

oh wait, it appears that an irc listener was not configured to pick it up properly which put up the illusion that nothing was being passed through, is actually working fine though, thanks for your input though! "is embarrassed"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM