Mailinglist Archive: opensuse-programming-de (33 mails)

< Previous Next >
Re: [opensuse-programming-de] executing a command in xterm and keep interactive
  • From: Olaf Dabrunz <Olaf@xxxxxxxxxxx>
  • Date: Sat, 19 Jan 2008 17:51:53 +0100
  • Message-id: <20080119165153.GA27495@xxxxxxx>
On 19-Jan-08, Hans-Peter Jansen wrote:
Hi,

I'm trying to automate some processes, where an initial command should run
inside a xterm, and the xterm kept interactive thereafter (xterm -e ...).

Since the culprit seem bash, I've tried most ways of invoking bash
with -i, -s and -c options, but as soon as I give bash the -c option, it

The only possibility I see is to start an interactive shell and let it
read your initial command from a special rcfile:

xterm -e bash --rcfile my_command

-- my_command: --------------------------------------------------
#!/bin/bash

# this mini-script is sourced instead of $HOME/.bashrc, so we source
# $HOME/.bashrc anyway, before or after "your command"
. $HOME/.bashrc

your command
-----------------------------------------------------------------

(Also, usually, in this case you do not need the -i option to bash.)

Otherwise, if you used the -c option to read commands from a string, you
can not change (redirect) the command source anymore, as it is not
through an open file but just the command line argument that is
interpreted by the shell. The shell will inevitably terminate after all
commands have been processed.

Regards,

--
Olaf Dabrunz (Olaf <at> dabrunz.com)

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-programming-de+help@xxxxxxxxxxxx

< Previous Next >
References