Find the answer to your Linux question:
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 ...
  1. #1
    Just 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

  2. #2
    Linux User
    Join Date
    Nov 2009
    Location
    France
    Posts
    292
    sh ./server2 start_with_outpur
    Are you sure 'start_with_outpur' is correctly typed in your terminal ?

    Why do you launch a new GUI terminal ? It will also hang your script.

    #!bin/sh
    should be
    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.

  3. #3
    Just 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........

  4. #4
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    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.

  5. #5
    Just 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..........

  6. #6
    Linux Newbie theNbomr's Avatar
    Join Date
    May 2007
    Location
    BC Canada
    Posts
    150
    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.

  7. #7
    Linux User
    Join Date
    Nov 2009
    Location
    France
    Posts
    292
    Code:
    gnome-terminal -e <command>
    You really and really don't need to do that in a script !
    0 + 1 = 1 != 2 <> 3 != 4 ...
    Until the camel can pass though the eye of the needle.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...