Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How do I run .sh files in Terminal?

I need to install a special patch for vmware. To do this, I downloaded the file and it was the file "linux", a text editor, it looks like this:

#! / bin / sh

case "` uname-m `" in
     x86_64)
         "$ 0" _64 "$ @"
         ;;
     *)
         "$ 0" _32 "$ @"
         ;;
esac

But how do I run it?

share|improve this question
add comment

marked as duplicate by Eliah Kagan, jokerdino, Mitch, devav2, Tom Brossman Oct 7 '12 at 11:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers

To run a shell script you first give it permissions:

chmod u+x nameofthescript

Then you run it. Assuming you're in the directory where the script is:

./nameofthescript

If it needs to run with root privileges:

sudo ./nameofthescript
share|improve this answer
add comment

Use a terminal and enter sh /path/to/script.sh.

For example, sh ~/Downloads/script.sh if your script is in your downloads folder.

share|improve this answer
add comment

The file you've downloaded is a script file writter un shell ( the first line are the interpreter). So to launch it, you have to open a terminal, like root45 said, terminal can be gnome-terminal or xterm program. The go the directory where you're shell script is saved (command cd), than launch manually your script : sh yourscript.sh

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.