Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting a new bash shell from a bash shell

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?

like image 761
providence Avatar asked Jun 02 '11 18:06

providence


People also ask

How do I change from one shell to another?

To change your shell use the chsh command: The chsh command changes the login shell of your username. When altering a login shell, the chsh command displays the current login shell and then prompts for the new one.

How do I change shell to bash shell?

Bash shell read commands such as ls, date and others typed into a terminal and then run them. That is the primary function of bash shell. To change your shell to bash use the chsh command.

How do I run a bash shell?

In order to run a Bash script on your system, you have to use the “bash” command and specify the script name that you want to execute, with optional arguments. Alternatively, you can use “sh” if your distribution has the sh utility installed. As an example, let's say that you want to run a Bash script named “script”.


1 Answers

Try:

bash -c 'gnome-terminal -x cd /absolute-path && program_name'
like image 138
lukasz Avatar answered Sep 24 '22 23:09

lukasz