Monday, February 28, 2011

Why Bash Shell?

  1. Shell script written in Bourne shell (sh) can be executed in Bash without any modification
  2. Shell script written in Bash shell can be executed in Korn Shell(ksh) without any modification
  3. Bash incorporates useful features from Korn shell and C shell
  4. Bash shell is the default shell in GNU/Linux systems

Sunday, February 27, 2011

Shell scripting advantages and disadvantages

Advantages:

  1. To automate the frequently performed operations
  2. To run sequence of commands as a single command
  3. Easy to use
  4. Portable (It can be executed in any Unix-like operating systems without any modifications)


Disadvantages:

  1. Slow execution speed compared to any programming languages
  2. A new process launched for almost every shell command executed

Saturday, February 26, 2011

Shell Scripting Cycle

1. Creation of script
                             Inclusion of specific shell absolute path (eg: #!/bin/bash )
                             Inclusion of comments about the functionality of the script
                             Inclusion of Unix commands and scripting language constructs

2. Setting up execute permission to the script
3. Execution of script
4. Debugging of script

Friday, February 25, 2011

Shell Script

Unix command(s) or/and shell programming logic written in a file to accomplish certain specific objective is called shell script.

Shell scripts are small programs written using shell and Unix commands and interpreted by shell.

Thursday, February 24, 2011

Shell Scripting language

Different kinds of shells used or available in the Unix/Linux operating system contains a built-in programming language referred to as shell scripting language.

Brief Shell History

First Unix Shell: Thompson Shell -> Implemented in the first version of Unix in 1971 by Ken Thompson.

sh (Bourne Shell) is the full featured Unix shell written by Stephen Bourne at Bell labs in 1974.

Other shells are,
bash (Bourne again shell)
ash (almquist shell)
csh (c shell)
ksh (Korn shell)
tcsh (TENEX c shell)
zsh (z shell)

Wednesday, February 23, 2011

What is Shell in Unix/Linux?

Shell is a command interpreter program which acts as an interface between the user and the Unix/Unix-like operating systems.

Primary objective is to read commands from console/terminal and then execute them.

Two major feature of any shell:
  • Acts as Interpreter
  • Acts as programming environment or capability which allows you to write & execute shell script