-1

I am opening a gnome-terminal using the following code as advised here:

system("gnome-terminal -e \"bash -c \"echo foo; echo bar; exec bash\"\"");

But the terminal does not remain open. What should I do?

Community
  • 1
  • 1
B Faley
  • 17,120
  • 43
  • 133
  • 223

1 Answers1

1

Try

system("gnome-terminal -e \"bash -c \'echo foo; echo bar; exec bash\'\"");

The commands after bash -c needs to be in single quotes. At least it worked for me then.

Teh Suu
  • 1,759
  • 1
  • 11
  • 7