How to run .sh file

1

I am using Ubuntu and just downloaded the jmonkey game engine. Everything appears to be in a single .sh file. I am not really sure how I am supposed to run this.

http://jmonkeyengine.com/

chief

Posted 2011-05-02T22:23:04.557

Reputation:

Answers

6

Um...if it's not in your $PATH:

./your_shell_script.sh

Or if it's not in your $PATH and it's not executable:

sh your_shell_script.sh

Or if it's in your $PATH:

your_shell_script.sh

Alex

Posted 2011-05-02T22:23:04.557

Reputation:

Do the second one if the file is not executable. Otherwise you need to have #!/bin/bash as the first line of the file, and then do chmod +x your_shell_script.sh – None – 2011-05-02T22:28:12.680

I moved the file into my home directory and made it executable. It works now. – None – 2011-05-02T22:31:08.943

1

Simple answer: './FILE.sh' or 'sh FILE.sh'. If you can't execute it, chmod +x FILE.sh

wrangler

Posted 2011-05-02T22:23:04.557

Reputation: 171

0

try sh -x single .sh file (assuming the +x permissions are set). Also I am assuming you probably need some jdk/jre installation.

user735148

Posted 2011-05-02T22:23:04.557

Reputation:

0

Try this:

$ nohup ./your_file.sh <arguements> &

Sid

Posted 2011-05-02T22:23:04.557

Reputation: 103

0

A quick alternative to

sh my_bash_script.sh

is to use double dots as follows:

. ./my_bash_script.sh

This is useful if the file does not have the execute bit set.

Richard Keller

Posted 2011-05-02T22:23:04.557

Reputation: 331