Shell script

Asked by Kim

I'm completely new to Linux:

How do you run a shell script?

I have tried to run the script in the terminal program (./program name) but I get the message "try to run this as root". How do I do that?

Thank you for any help

Kim

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Sergio Albert González
Solved:
Last query:
Last reply:
Revision history for this message
Sergio Albert González (sergio-albert) said :
#1

You are trying to get in the dark side... So you will need at least a road map. The entrance door is "Aplications --> Accesories --> Terminal <--", also you can try the keys "CTRL+ALT+F1..6" and "CTRL+ALT+F7" to get back home.

once there type "sudo su" and type your (administrator) password

Good luck, it's easy.
Sergio

Revision history for this message
Mike Perry (mike.perry) said :
#2

Kim,
That is kind of a loaded question. I say this because there is a very long answer to your question and a short answer to your question. From the information that you have provided I cannot determine which one you are looking for.

Running a program as root is as simple as the Sergio (above) described. In short you can always "sudo ./program" this will run the file located at "./program" as root. Alternatively you could get a root shell first by typing "sudo -s" after which you will receive a root prompt "#". While you have your root prompt all commands that are executed will run as root.

root is an administrative type of user. Most programs do not need to be run as root. As a general rule you only need to be root when installing/removing/or configuration. There may be a few other cases but I won't get into them here.

Shell scripts themselves are very much like DOS batch files -- if you are farmilar with those. However they provide much more functionality.

If what I am describing does not completely answer you question I would highly recommend reading the following tutorial:
http://www-128.ibm.com/developerworks/linux/lpi/?S_TACT=105AGX03&S_CMP=ZHP

Hope this helps.

Revision history for this message
Kim (send-post) said :
#3

Resolved