Results 1 to 3 of 3

Thread: Need to change the working directory of my script.

  1. #1
    Join Date
    Nov 2009
    Beans
    87
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Need to change the working directory of my script.

    I have a script that should start my Minecraft server. The script is a follows:

    #!/bin/bash
    java -Xincgc -Xmx1G -jar "/home/jamie/Programs/Minecraft Server/craftbukkit-0.0.1-SNAPSHOT.jar"

    The script is located in my scripts directory in my home folder and it is in my path. But when I execute the script the server starts writing all the data to my home folder(The directory I am in). How can I tell the script to change its working directory to the server folder? Thanks.

  2. #2
    Join Date
    Aug 2006
    Beans
    13,354
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: Need to change the working directory of my script.

    Start the script with cd /server-folder?

  3. #3
    Join Date
    Nov 2009
    Beans
    87
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: Need to change the working directory of my script.

    That worked. Thanks. For some reason I thought it wouldn't. I think I tried something similar in the past and it didn't work.

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
  •