Question

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?

Was it helpful?

Solution

Escape the double quotes :

char *mycmd = "gnome-terminal --profile 'me' -e '/usr/bin/programA --file/usr/bin/config/myconfig.ini --name=\"programA\" --loggingLevel=1'";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top