Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

how to run shell script in linux

how to run shell script in linux

 
Post new topic   Reply to topic     Forum Index -> Linux os
View previous topic :: View next topic  
Author Message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Wed Oct 29, 2008 4:17 pm    Post subject: how to run shell script in linux Reply with quote

How to run our shell scripts program in linux terminal prompt. I tried different way to execute my shell script.
Back to top
View user's profile Send private message
seniormember
Site Admin


Joined: 20 Jul 2008
Posts: 77

PostPosted: Wed Nov 05, 2008 3:13 pm    Post subject: Reply with quote

A shell script is easier way to run command on linux system, it is something like DOS of bat file. Where can we define some command in a file and save this file as shell and finally run this shell script.

Linux provides number of command shell which are

1. C shell (csh),
2. Korn shell (ksh),
3. Bourne shell (sh),
4. Bourne-Again shell (bash)


so you need to know first which shell you are using
second do you have given permission to shell script file to execute.

Suppose i have shell script myShell.sh

Quote:
#chmod 755 myShell.sh


if you are using bourne shell (sh)

command to run shell will be

Quote:
#sh myShell.sh


if you are using C shell (csh)

command to run shell will be
Quote:
#csh myShell.sh



another way to run shell

Quote:
#./myShell.sh
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Linux os All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack