LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-21-2008, 07:55 AM   #1
safwa
LQ Newbie
 
Registered: Feb 2008
Posts: 5

Rep: Reputation: 0
Lightbulb Plz Help me Out.....


good day gentalmen,

I have one question:

I have 3 scripts and I want to put them in one script when I run it. It will open the 3 scripts in different 3 terminals instead of run each one alone. ……plz help me out.

These are the names of the scripts.

1. mon.sh
2. opr2.sh
3. opermenu.sh


regards,
 
Old 02-21-2008, 07:58 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I'm not sure I understand the problem. You want to run these three scripts sequentially from one main script?
 
Old 02-21-2008, 08:05 AM   #3
safwa
LQ Newbie
 
Registered: Feb 2008
Posts: 5

Original Poster
Rep: Reputation: 0
yes plz

form one main script.
 
Old 02-21-2008, 02:39 PM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Code:
#!/bin/sh

for script in mon.sh opr2.sh opermenu.sh ; do
  xterm -e "$script"
done
If you want all three windows open at the same time:

Code:
#!/bin/bash


let i=0
for script in mon.sh opr2.sh opermenu.sh ; do
  xterm -e "$script" &
  pids[$i]=$!
  let i++
done

for pid in ${pids[@]} ; do
  wait $pid
done
 
Old 02-22-2008, 06:35 AM   #5
safwa
LQ Newbie
 
Registered: Feb 2008
Posts: 5

Original Poster
Rep: Reputation: 0
thanks but I want to open the 3 scripts in a terminal not in xterm. Moremover, when I write the last script that you gave me it "
#!/bin/bash
let i=0
for script in mon.sh opr2.sh opermenu.sh ; do
xterm -e "$script" &
pids[$i]=$!
let i++
done

for pid in ${pids[@]} ; do
wait $pid
done


it opens the scripts in sequence not in the same time...

thanks for your cooperations and promote responde.

regard,
 
Old 02-22-2008, 07:01 AM   #6
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
How about using screen?
 
Old 02-22-2008, 11:47 PM   #7
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by safwa View Post
thanks but I want to open the 3 scripts in a terminal not in xterm.
Sorry, I'm not clear on what a "terminal" is (xterm is short for X terminal ...).

Quote:
Moremover, when I write the last script that you gave me it
...
it opens the scripts in sequence not in the same time...
Well it doesn't start them at exactly the same time, but I don't think that's really possible. What I meant by "open at the same time", is that it won't wait for the first to finish before opening the second one.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PLZ, PLZ help - need some info kevmif Linux - General 9 12-17-2007 06:12 AM
plz plz help me regarding route mapping nedian123 Programming 1 07-13-2004 08:17 AM
plz plz solve my route mapping problem nedian123 Linux - Networking 1 07-12-2004 09:41 PM
plz, help me (plz realy ) h4ng4m3 Linux - General 10 08-18-2003 06:07 AM
redhat problems plz plz help sap666 Linux - Newbie 5 07-30-2003 10:57 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:29 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