LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-15-2011, 01:12 PM   #1
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Rep: Reputation: 24
bash and xterm: how make apps started by and for a script persist when script terminates


I issue the command
Code:
 xterm -title ScriptTesting -e bash /home/g/Scripts/rt.sh &
rt.sh contains
Code:
#!/bin/bash

sleep 2
cd /home/g/Scripts
jedit &
rxvt -e lynx http://www.google.com &
sleep 10
When rt.sh terminates, lynx, jedit and xterm "ScriptTesting" all terminate as well. How can I keep them open?

Last edited by porphyry5; 06-15-2011 at 01:15 PM. Reason: expanded title
 
Old 06-15-2011, 01:16 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Try the option -hold of xterm.
 
Old 06-15-2011, 01:18 PM   #3
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by colucix View Post
Try the option -hold of xterm.
Already tried that, the xterm stays open but has no prompt, and the only thing I can do with it is close it down.
 
Old 06-15-2011, 01:22 PM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
What if you start a shell session after the script execution?
Code:
xterm -hold -title ScriptTesting -e "bash /home/g/Scripts/rt.sh && /bin/bash"
 
1 members found this post helpful.
Old 06-15-2011, 01:27 PM   #5
porphyry5
Member
 
Registered: Jul 2010
Location: oregon usa
Distribution: Slackware 14.1, Arch, Lubuntu 18.04 OpenSUSE Leap 15.x
Posts: 518

Original Poster
Rep: Reputation: 24
Quote:
Originally Posted by colucix View Post
What if you start a shell session after the script execution?
Code:
xterm -hold -title ScriptTesting -e "bash /home/g/Scripts/rt.sh && /bin/bash"
Thank you, that made all the difference, all three now persist, and I have a prompt in the xterm.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
initiation script terminates webpage ted_chou12 Linux - Newbie 0 02-16-2011 11:03 AM
[SOLVED] How to make a bash script keep running in same terminal after it calls second script? JohnRock Linux - Newbie 4 06-25-2010 09:16 AM
Make a script that uses the output from another script as the variables? Oakems Programming 11 06-18-2009 05:21 PM
script executed inside another script dont make changes potraike Linux - Newbie 4 03-05-2008 05:27 AM
shell script terminates as zombie, ie, <defunct> Kropotkin Linux - Newbie 3 02-20-2007 12:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration