xterm -e closes when script is done


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers xterm -e closes when script is done
# 1  
Old 09-11-2011
xterm -e closes when script is done

I want to open multiple xterm windows, run different programs in each and have each xterm window stay open - to use as I wish. I have written a ksh script that uses "xterm -e scriptname" (multiple times). The xterm windows do open successfully. However, when "scriptname" completes, the xterm windows close. How can I get the windows to remain open once "scriptname" completes? I want the windows to be useable for further commands.
# 2  
Old 09-11-2011
Try
Code:
xterm -hold -e <script>&

# 3  
Old 09-12-2011
unfortunately, my unix environment (Sun OS) does not support the "-hold" option of xterm.

I want to be able to execute a set of commands in separate xterm windows and have those windows remain open. I don't have to use the "-e" option of xterm, but so far that's the only way I can figure how to get commands into the xterm windows.

Any other thoughts?
# 4  
Old 09-12-2011
Hmm. xterm -e 'scriptname ; exec /bin/sh' ?

If -e doesn't support shell statements, you can run a shell to run the shell Smilie

xterm -e /bin/sh -c "scriptname ; exec /bin/sh"

---------- Post updated at 10:59 AM ---------- Previous update was at 10:53 AM ----------

Or, if you just wanted it to wait forever instead of opening a shell:

xterm -e /bin/sh -c "scriptname ; while true ; do sleep 100 ; done"
# 5  
Old 09-12-2011
Great suggestions! I will try them out tomorrow at work. Thanks so much for your help!!Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Telnet connection closes before i execute GET command

I tried the below steps for telnet command from a remote server: 1. telnet myservice.com 443 2. GET / HTTP/1.0 3. Press enter key twice Please see the output below: bash-3.2$ hostname remoteserver1 bash-3.2$ telnet myservice.com 443 Trying 191.172.172.133... Connected to... (7 Replies)
Discussion started by: mohtashims
7 Replies

2. Shell Programming and Scripting

Error while running xterm in telnet script

Error: Type xterm -help for a full description. xterm: Explicit shell already was /root/Desktop/telnet.sh xterm: bad command line option "Done!" usage: xterm (0 Replies)
Discussion started by: sk151993
0 Replies

3. Shell Programming and Scripting

New bash menu printing errors but closes too quickly

I am beginning to write a new version of the bash menu below. The previous version worked great and now when I start the updated bash it opens and a some lines print in the terminal and it closes quickly. I know there are errors but how can I see them or fix them, I tried set -x with the same... (12 Replies)
Discussion started by: cmccabe
12 Replies

4. Shell Programming and Scripting

Bash menu opens and closes

Ever since I added these two code blocks to my bash menu it just opens and closes right away. I use a batch file that worked fine until these codes were added and I am not sure what is wrong. Basically, what I am trying to do in the additional section is if the answer is "Y" then it goes back... (13 Replies)
Discussion started by: cmccabe
13 Replies

5. Solaris

Login/xterm and run script

Hi - I need to have a script run automatically when I login to my solaris 10 system (running CDE). I stuck this in my .cshrc file: xterm -e /bin/sh -c "/.script-name; exec /bin/sh" When I login, a window comes up and runs the iteractive script-name, and then when the script is done, my... (4 Replies)
Discussion started by: pyroman
4 Replies

6. Solaris

sftp connection closes if idle for around 10minutes

does sftp connection closes by default if it stays idle for a prolonged time ? i have checked sshd_config files , there is no time out value set. but still the connection closes after certain period of time. Please help. verbose mode output : sftp> debug1: channel 0: free:... (10 Replies)
Discussion started by: chidori
10 Replies

7. SuSE

NoMachine NX window closes after establishing connection

Hi, I am trying to use nomachine nx server and client. But somehow it doen't work. What happens is the following: 1.- Client starts up 2.- Client authenticates with Server 3.- The NoMachine window appears for 2-4 seconds 4.- The NoMachine window exists Somehow a "closeEvent" is sent.... (3 Replies)
Discussion started by: blackicecube
3 Replies

8. UNIX for Advanced & Expert Users

SSH closes connection when using arrow keys

Hi, I'm having a problem with my ssh link to various Sun servers running Solaris 9 and 10 from an Windows XP box running Cygwin/X. I am using ssh to connect to a number of different Sun servers. My problem is that when editing a remote shell command line with the arrow direction keys the... (0 Replies)
Discussion started by: stv_t
0 Replies

9. UNIX for Dummies Questions & Answers

export script commands with xterm

I am attempting to write a shell script that runs a program which generates data and then runs another program to plot the data. The problem is that I need the plotting to take place in a different terminal window that stays open after the plotting has finished. I have experimented 'xterm -e '... (1 Reply)
Discussion started by: chris2051
1 Replies

10. Programming

multiuser chat server closes when one client closes. code included

I have been trying to write a very basic chat program but at the moment I am having problems getting it to be multiuser as it closes all connections when one client shutsdown. I have also been having problems trying to get the program to display a list of usernames to the clients. I have tried... (0 Replies)
Discussion started by: dooker
0 Replies
Login or Register to Ask a Question