September 22, 2020, 01:24:05 PM

News : Linux Help Community Forum..

Author Topic: Running shell Script  (Read 2953 times)

Offline shipoin_97

  • Tux Awared
  • **
  • Posts: 44
Running shell Script
« on: December 10, 2005, 06:29:56 AM »
DeAr ,

        I am a newbie runnig shell scripting in Linux .  I have the following questions like ,

        1) If i wrte a  script  like
               #make_page - A Script to produce an HTML file
              title="System Information for"
            cat <<- _E OF_
         $title $shipon
    <H1>$title $shipon</H1>
            How can i run it ? or using which cammand i  show my system information .

2 ) if  i  write the following script

              function system_info
    echo "<h2>System release info</h2>"
    echo "<p>Function not yet implemented</p>"

 How i can run it ?

                          Plz help me ........

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
Running shell Script
« Reply #1 on: December 14, 2005, 01:56:18 PM »
If u wan to run the script u have to change ur script to executable file first.

# chmod +x

To run it:
# ./

To run a function:
1. Your function must be at the top most of the script after #!/bin/bash or #!/bin/sh
2. To initiate/call the function just type name of the function:

Code: [Select]

  echo "HelloWorld"

# Just call the function name

Got it?