![]() |
Is there anyway to execute bash as interactive and run a command?
I'm trying to start bash with a command and have it interactive like this:
bash -i -c "echo Welcome!" As in, execute the command and allow me to use it as an interactive shell afterwards. (I'm doing something more complicated than echoing, but this doesn't work.) I've tried this from a running gnome-terminal, from one gnome-terminal to a new one with gnome-terminal and from the Alt+F2 program launcher (with "Run in terminal" ticked). Any ideas? |
Google is your friend.
bash startup message result (among many others): http://ubuntuforums.org/showthread.php?t=580470 have fun, jdk |
Nope, that's not what I'm looking for.
Here's the situation: Whilst programming junk, I like to have a couple of terminals open, to different directories, and one running ipython in the source directory. So I'm going to need to run a couple of different commands. I don't want to have to replace my .bashrc. |
Maybe I don't follow you, but why not just open half a dozen gnome-terminals before you start?
|
Yeah, that's what I'm trying to do. Except I'd like to do it from a script (easy) and have each of them execute a separate command (e.g., change directory, start ipython, set some environment variables). I reckon I could switch out the .bashrc before each call, but that seems like the wrong way to do it.
|
So the problem is to open a new terminal from the command line executing a command and keep it open for interactive usage, right? Take a look at a solution here. You can try to write a function that do the trick or even some aliases, each of them running a specific command.
|
That's exactly what I wanted. The gnome-terminal -x switch is the key, and it's not in the --help. It is in the man page, however, so I suppose I should have RTFM. :P
|
| All times are GMT -5. The time now is 05:59 PM. |