Results 1 to 6 of 6

Thread: Bash Script Help

  1. #1
    Join Date
    Jun 2011
    Beans
    38

    Bash Script Help

    Hello everyone. I am trying to write a bash script to run the PlayerStage project. I just want to get three programs running. They have to be going at the same time, which is beyond my bash skills...

    Here is my current script:

    #!/bin/bash
    #This script brings up the player driver. (Ya. I'm lazy.)

    cd ~/Code/Eli
    #Bring up the robot on the localhost. (Port 6665)
    player stage.cfg
    #Bring up the planner proxy on the same host. (Port 6666)
    player wavefront.cfg

    #Now that both servers are established, bring up PlayerNav.
    playernav localhost:6665 localhost:6666

  2. #2
    Join Date
    Sep 2006
    Beans
    8,623
    Distro
    Ubuntu 14.04 Trusty Tahr

    ampersand

    Putting an ampersand (&) after each program will cause it to run in the background.

    e.g.

    player stage.cfg

    becomes

    player stage.cfg &

    and will run in the background.

  3. #3
    Join Date
    Apr 2010
    Beans
    498
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Bash Script Help

    Hi, I'm unfamiliar with PlayerStage, so probably I'm not the best option to answer this but I can help you with your scripting, so what's the problem with the one you posted, what error message is prompted?
    Bad command. Bad, bad command! Sit! Stay! Staaaaay!!!.

  4. #4
    Join Date
    Jun 2011
    Beans
    38

    Re: Bash Script Help

    Well, the ampersand didn't work... I don't know why, but it didn't... The PlayerStage project is a mobile robotics platform. It is a server that communicates to the robots.

  5. #5
    Join Date
    Nov 2010
    Location
    California, USA
    Beans
    195
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Bash Script Help

    #!/bin/bash -x
    # adding -x puts you in to verbose so you can see things executing
    #This script brings up the player driver. (Ya. I'm lazy.)

    cd /home/user/Code/Eli #use the absolute path, not ~
    #Bring up the robot on the localhost. (Port 6665)
    player stage.cfg #are you sure this is an executable? It looks like a config file
    #Bring up the planner proxy on the same host. (Port 6666)
    player wavefront.cfg #same thing here, looks like a config file

    #Now that both servers are established, bring up PlayerNav.
    playernav localhost:6665 localhost:6666

  6. #6
    Join Date
    Apr 2010
    Beans
    498
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Bash Script Help

    Well, can you tell us whether executing each command from a console works?
    Bad command. Bad, bad command! Sit! Stay! Staaaaay!!!.

Tags for this Thread

Bookmarks

Posting Permissions

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