ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
#!/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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.