Tom
Tom

Reputation: 1057

Process gets killed after xterm terminates

I want to run xterm terminal in C++ to create a Linux process like this

system("xterm -e adb start-server")

The adb process is created but after that command it gets killed. I was trying to solve this problem by using nohup and screen but nothing works. I know that I have to put the adb process into background, but how to do that with xterm?


Edit:

I'm loking for solution that will terminate/close the xterm window, but not the adb process. Later I want to use multiple commands in the same xterm window like

system("xterm -e \"adb start-server; adb connect 192.168.X.XXX;\"");

and all output (and eventually errors) I want to see in the same xterm.

Upvotes: 0

Views: 403

Answers (1)

fghj
fghj

Reputation: 9394

You can do it like this:

xterm -e /bin/bash -c "adb start-server; /bin/bash"

Upvotes: 1

Related Questions