문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top