0
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?

ymn
  • 2,175
  • 2
  • 21
  • 39

1 Answers1

2

Escape the double quotes :

char *mycmd = "gnome-terminal --profile 'me' -e '/usr/bin/programA --file/usr/bin/config/myconfig.ini --name=\"programA\" --loggingLevel=1'";
Intrepidd
  • 19,772
  • 6
  • 55
  • 63
  • Your second option won't work because the `-e '/usr/bin/programA --file/usr/bin/config/myconfig.ini --name='programA' --loggingLevel=1'` section is already wrapped in single quotes. You'd need to escape either type. – m.brindley Feb 01 '13 at 10:01