0
Shell Scripting           Linux shell programming02/26/13
Introduction• A shell is a program constructed of shell commands  ( $shell,$path,Ls,pwd,mkdir..)• Shell is an environment ...
Features of Shells• Shells are CASE SENSITIVE.• Shells allows interaction with kernel.• Shells allow one to create functio...
Types of shells• Following types of shells are available in linux:           Shell Name      Developer     Promp Descripti...
Shell Scripting• A script is defined as just a plain text file or ASCII   file    – with a set of linux / unix commands.  ...
• Shell script allow use of variables.• Shell scripts are interpreted directly and are not  compiled as cc++ codes.• Shell...
Example of Shell scripting02/26/13
Structure of a script• #!/bin/bash –it defines that in which shell will be used  to run the script.• # comments –comments ...
Advantages of shell scripting• Shell script is much quicker  than programming in any  other languages.• To automate the fr...
Disadvantages of shell scripting• Slow execution speed.• Prone to costly errors.• Compatability problems02/26/13
References Shell Scripting for Unix/Linux: Shell scripting  advantages and disadvantages Bash Shell Script Function Exam...
02/26/13
Upcoming SlideShare
Loading in...5
×

Shell Scripting in Linux

2,032

Published on

Tells about the shells and how to get started with shell programming.with a snapshot of a basic shell script.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,032
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
83
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Shell Scripting in Linux"

  1. 1. Shell Scripting Linux shell programming02/26/13
  2. 2. Introduction• A shell is a program constructed of shell commands ( $shell,$path,Ls,pwd,mkdir..)• Shell is an environment for user interaction.But it is not a part of kernel.• Shell is just like as BAT files in MS-DOS.• By default,Bash shell is default shell for Linux. 02/26/13
  3. 3. Features of Shells• Shells are CASE SENSITIVE.• Shells allows interaction with kernel.• Shells allow one to create functions and pass arguments to them.• Shells provide help for each and every command using man or help.• Helps in automation of tasks and thus time saving02/26/13
  4. 4. Types of shells• Following types of shells are available in linux: Shell Name Developer Promp Description t Bash – Brian Fox & $ Bash is the replacement Bourne again Chet Ramey of sh shell.It provides many tools for editing and manipulating history. CSH - C shell Bill Joy % C shell has its syntax much same as that of C language. Some other types of shells available are KSH Korn shell,TCSH tenex/Tops C shell02/26/13
  5. 5. Shell Scripting• A script is defined as just a plain text file or ASCII file – with a set of linux / unix commands. – Flow of control – IO facilities• A shell script can be created using any text editor like vim,emac,notepad++ etc. 02/26/13
  6. 6. • Shell script allow use of variables.• Shell scripts are interpreted directly and are not compiled as cc++ codes.• Shells provide many features including loop constructs,arrays,variables,branches and functions.• shells provide logic with other utilities like pipelining,redirection etc.• Shells allow file and directory management features.02/26/13
  7. 7. Example of Shell scripting02/26/13
  8. 8. Structure of a script• #!/bin/bash –it defines that in which shell will be used to run the script.• # comments –comments can be made by using # symbol in a script.• Chmod +x script.sh – to tell the linux that file is executable.• ./script.sh to execute the script. To check current shell ,type following: echo $SHELL.02/26/13
  9. 9. Advantages of shell scripting• Shell script is much quicker than programming in any other languages.• To automate the frequently performed tasks.• Easy to use and understand. Non-geeks can also modify scripts.02/26/13
  10. 10. Disadvantages of shell scripting• Slow execution speed.• Prone to costly errors.• Compatability problems02/26/13
  11. 11. References Shell Scripting for Unix/Linux: Shell scripting advantages and disadvantages Bash Shell Script Function Examples Linux Shell Scripting Tutorial - A Beginner's handbook LinuxHelp.net02/26/13
  12. 12. 02/26/13
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×