Pergunta

char *mycmd = "gnome-terminal --profile 'me' -e '/usr/bin/programA --file/usr/bin/config/myconfig.ini --name="programA" --loggingLevel=1'";
popen(mycmd, "r");

Error on 1st line: error: expected ';' before 'Node'

I know this is because of the "" for --name

Is there anyway to get this command to work?

Foi útil?

Solução

Escape the double quotes :

char *mycmd = "gnome-terminal --profile 'me' -e '/usr/bin/programA --file/usr/bin/config/myconfig.ini --name=\"programA\" --loggingLevel=1'";
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top