Hello,
I am trying to learn how to pass more than a one-command startup for gnome-terminal.
I will give an example of what I'm trying to do here:
Code:
#! /bin/bash
#
#TODO write this for gnome and xterm
USAGE="
______________________________________________
${0##*/} [-x] [-g]
run midnight commander in a terminal window
-x run in xterm (the default)
-g run in gnome
______________________________________________
"
mcTerm () {
sleep .5
mc
bash
}
export -f mcTerm
if [ "$1" = -h ] ; then echo "$USAGE" ; exit ; fi
if [ $# -lt 1 -o "$1" = -x ]; then
(
xterm -maximized -e mcTerm
) &
else
(
gnome-terminal -x mcTerm
) &
fi
The default option runs xterm without any problem.
However, running with the -g option to invoke gnome-terminal, I get a "There was an error creating the child process for this terminal" error.
This same error occurs if the gnome-terminal line is changed to
Code:
gnome-terminal -e mcTerm
Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.
With thanks,
Narnie