FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Running script under Linux

 


pluto
I was sent a link to a script I need to run on my Ubuntu machine, but the script is only text on a html page. If I copy the script to a text file, what steps do I need to take so I can run this script?

The script is a configuration script for a application that is not native to Linux.

Thanks for your help!
MrBlueSky
If it is a shell-script you can type

Code:


source nameofscript



at the command line (where nameofscript is the filename of the script).
teko
you will also need to give it the correct permissions to be able to run it i.e. make is executable.

Another thing to be careful of is if you save it in windows you will get a lot of ^M´s in it if you copy it over to ubuntu then. If you´re copying from a web browser in ubuntu then you´ll have no problems. Hope this helps, let us know if you need more help
pluto
Thanks to everyone who answered my post. I copied the script from the web page, and pasted the script in a basic text editor and saved the file. I then made sure I had the proper permissions to execute the script (ls -l). After confirming the proper permissions, I executed the script by typing "./name_of_script". The script executed successfully.

Very Happy
jackill
With Bash scripts it's simple:

get exec permissions: chmod +x filename

run: ./filename

or: sh filename

or: bash filename

see -> http://www.freeos.com/guides/lsst/ch02sec01.html
infobankr
Shell scripting rocks. Its amazing what you can do with a simple blinking cursor!
MrBlueSky
teko wrote:
you will also need to give it the correct permissions to be able to run it i.e. make is executable.



That's not necessary when you want to run shell scripts. If you run them using 'source' or as a parameter to a new instance of a shell they don't have to be executable.
Reply to topic    Frihost Forum Index -> Computers -> Operating Systems

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.