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?
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.
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.
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”.
Try:
bash -c 'gnome-terminal -x cd /absolute-path && program_name'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With