Page 1 of 1

running in an xterm

Posted: Sun Sep 07, 2008 6:41 pm
by tom
hey guys,

most Terminal Emulators can be given an "-e" option to run programs. If I type "xterm -e /path-to-my-script" an xterm fires up and runs the script.

is there a way to open an xterm in a script which then executes the script that opens it? (yes, convoluted..)

I want to click a button to run a script in an xterm. the way I do it now is to write a shell script that starts the xterm that starts the script, and I'd like to reduce it down to one step.

I just confused myself.
:-)

Posted: Sun Sep 07, 2008 9:13 pm
by Lutz
try: (exec "xterm -e myscript")

Posted: Sun Sep 07, 2008 10:16 pm
by tom
That will work if I include it in myscript itself? Wouldn't that loop forever?

Posted: Wed Sep 10, 2008 1:18 pm
by aron
tom wrote:That will work if I include it in myscript itself? Wouldn't that loop forever?
If you call it allways then..

Not forever, but a long time I guess. It becomes a Recursive execution of the script and I think it needs more and more memory until there is no memory left, but maybe something else can occure.

I remember i read about an loop that looked like a newer ending loop but it was stopt by an (hardwar-related) exception and the execution was then restarted from the first line on that platform.