rxvt -e or xterm -e question

How do I keep an xterm open after it runs a command specified by -e?

In other words, if I issue

xterm -e "ls -lt"



it runs the command and disappears before I can read the output.

G5 2x2.5 GHZ and a few others, Mac OS X (10.4.3)

Posted on Jan 2, 2006 7:33 PM

Reply
5 replies

Jan 2, 2006 9:52 PM in response to Bill Scott

Hi Bill,
You could always tell the shell to wait for input. Thus, try something like:

xterm -e zsh -c 'ls -lt; read ANSW\?"God you are slow. Are you done yet? "'

You could of course simply tell the shell to sleep but I assume that you would prefer that it wait for you, since you read so slowly.
--
Gary
~~~~
I suppose one could claim that an undocumented feature
has no semantics. 😟
-- Larry Wall in <199710290036.QAA01818@wall.org>

Jan 3, 2006 9:23 AM in response to Bill Scott

Try the -hold flag. From the 'xterm' manpage:
<pre>
-hold Turn on the hold resource, i.e., xterm will not immediately
destroy its window when the shell command completes. It will
wait until you use the window manager to destroy/kill the win-
dow, or if you use the menu entries that send a signal, e.g.,
HUP or KILL.
</pre>

Dual 1.25 GHz G4 (among others) Mac OS X (10.3.9) Fink (obviously)

Jan 3, 2006 9:44 AM in response to Gary Kerbaugh

Thanks, Gary.

Right now I have it sleep for 600 seconds. But what I really want is for the terminal to list something and then be interactive, as if there was a command it read in (for example) ~/.zshrc

I suppose I can invent some silly conditional test, but I was wondering if there was a command line parameter to xterm or rxvt that would say "No Exit" (without the French accent.)

(I was put into special ed as a kid due to my slowness in reading.)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

rxvt -e or xterm -e question

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.