Results 1 to 7 of 7
Hello Friends,
I want to start servers which are running on my pc with one shell script.
what I wrote is.
#!bin/sh
cd /home/HUNT/server1
gnome-terminal
sh script/server start_with_output
cd /home/HUNT/server2
...
- 05-19-2010 #1Just Joined!
- Join Date
- May 2010
- Location
- Your Heart
- Posts
- 3
some script problems.
Hello Friends,
I want to start servers which are running on my pc with one shell script.
what I wrote is.
#!bin/sh
cd /home/HUNT/server1
gnome-terminal
sh script/server start_with_output
cd /home/HUNT/server2
gnome-terminal
sh ./server2 start_with_outpur
I saved the file as start.sh
on terminal I put sh start.sh
Result I got is:
A new terminal opened with current directory as /home/HUNT/server1
and server started running.
What I didn't get: second terminal and second server were not running.
I am figuring out my errors..........
regards
HUNT
- 05-19-2010 #2Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
Are you sure 'start_with_outpur' is correctly typed in your terminal ?sh ./server2 start_with_outpur
Why do you launch a new GUI terminal ? It will also hang your script.
should be#!bin/sh
Code:#!/bin/sh
Last edited by nmset; 05-19-2010 at 08:28 PM.
0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.
- 05-20-2010 #3Just Joined!
- Join Date
- May 2010
- Location
- Your Heart
- Posts
- 3
yes here I was quick to write.......ie why mistake happened......
all syntaxes are correct........
- 05-20-2010 #4
Without knowing what is in 'script/server', one would only assume that the script is waiting for 'script/server' to complete, before it proceeds to the next step. Perhaps you need to put some processes in the background?
--- rod.Stuff happens. Then stays happened.
- 05-21-2010 #5Just Joined!
- Join Date
- May 2010
- Location
- Your Heart
- Posts
- 3
let me be very precise what do I want,
I simply wrote a script to open a terminal and run the program in that.
I tried,
gnome-terminal --Load options....but didnt get success..........
- 05-21-2010 #6
Show us the script. What do you mean by "didn'nt get success"? Something happens but not the right thing? Nothing happens? Something bad happens? Please be specific. Post error messages if any exist.
Does it have to be gnome-terminal? What about, say, xterm? What about running the script's commands individually from a shell; what happens?
--- rod.Stuff happens. Then stays happened.
- 05-21-2010 #7Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
You really and really don't need to do that in a script !Code:gnome-terminal -e <command>
0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.


Reply With Quote