pTutorial

New way to learn Programming

How To Run Shell Script

How to execute / Run shell script or shell scrip program.

Requirement

  1. Text editor – leafPad or any
  2. Terminal

Both the terminal and leadfPad (text editor) are available in any Linux/Unix based operating system. So there is no need to do any extra thing.

How will be access the shell?

The shell is accessed to an application known as terminal In further you can find there

how to run shell script

Note: In order to create shell scrip program you must remember it. You have to input all the Unix command in lower case letter.

Four steps of executing shell script program

1. Type the script into the text editor like below

#hello.sh
Clear
echo "pTutorial";

2. Save this file with .sh extension. In my case it's ptutorial.sh.

3. Open terminal and type

chmod +x ptutorial.sh

Then

./ptutorial.sh

Output

pTutorial

4. Now you can see the output of the program.

Note: You must be in the same directory.

See Also


QUOTES OF THE DAY

Everything flows, nothing stays still.

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER