Reputation: 29463
I would like to run a program from the bash shell. When the program runs, it dominates the entire shell, so I would like to start a new shell and run the program from there. Currently I am doing:
gnome-terminal -x "cd Dropbox; program_name"
However that give me the error Failed to execute the child process, no such file or directory. I believe thats because the new terminal has no time to initialize. How can I fix this?
Upvotes: 19
Views: 88136
Reputation: 7550
I admit this doesn't really answer your question, but I think it solves your problem.
Why not just use &
to send it to the background. You can see if it's still running with jobs
and bring it back to the foreground with fg
, you can also send it back to the background, by first stopping it with Ctrl+Z then bg
Example to try.
> sleep 20 &
> jobs
> fg [jobNumber]
[Ctrl-Z]
> jobs
> bg [jobNumber]
> jobs
Upvotes: 10
Reputation: 2491
Try screen. Its a simple brogram that allows you to keep track of multiple shells at the same time. You can navigate through each of the open shells and even leave the session and reconnect later on.
Upvotes: 2
Reputation: 2398
Try adding "&" at the end of your command, e.g.:
gnome-terminal &
I don't know if it's working with gnome-terminal, but it worked well with mrxvt.
Upvotes: 1
Reputation: 42047
use the absolute path to the program or cd before calling gnome-terminal. And you need a & to put it in the background.
cd Dropbox; gnome-terminal -x "program_name" &
Upvotes: 1