running in an xterm

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
tom
Posts: 168
Joined: Wed Jul 14, 2004 10:32 pm

running in an xterm

Post 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.
:-)

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

try: (exec "xterm -e myscript")

tom
Posts: 168
Joined: Wed Jul 14, 2004 10:32 pm

Post by tom »

That will work if I include it in myscript itself? Wouldn't that loop forever?

aron
Posts: 8
Joined: Fri May 12, 2006 2:28 am
Location: Sweden
Contact:

Post 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.

Locked