if i understand correctly you want to have a gnome-terminal open, have it execute some commands, and then drop to the prompt so you can enter some more commands.
it seems to me that gnome-terminal is not designed for this use case, but there are workarounds:
let gnome-terminal run your commands followed by bash
$ gnome-terminal -e "echo foo; echo bar; bash"
strangely this does not work on my system. it will print foo; echo bar; bash
. i tried some escaping of the semicolons, but i did not manage to get it working the way i wanted. might be a "feature" of gnome-terminal.
let gnome-terminal run bash and tell bash to run your commands and then run bash
$ gnome-terminal -e "bash -c \"echo foo; echo bar; exec bash\""
the exec bash
at the end is necessary because bash -c
will terminate once the commands are done. exec
causes the running process to be replaced by the new process, otherwise you will have two bash processes running.
let gnome-terminal run bash with a prepared rcfile which runs your commands
prepare somercfile
source ~/.bashrc
echo foo
echo bar
then run
$ gnome-terminal -e "bash --rcfile somercfile"
let gnome-terminal run a script which runs your commands and then drops to bash
prepare scripttobash
#!/bin/sh
echo foo
echo bar
exec bash
set file as executable
then run
$ gnome-terminal -e "./scripttobash"
or genericscripttobash
#!/bin/sh
for command in "$@"; do
$command
done
exec bash
then run
$ gnome-terminal -e "./genericscripttobash \"echo foo\" \"echo bar\""
every method has it's quirks. you must choose, but choose wisely. i like the first solution for it's verbosity and the straightforwardness, if you manage to get it working.
all that said, this might be of good use for you: http://www.linux.com/archive/feature/151340