You are on page 1of 2

A shell script is a command line interpreter designed to be run by the Unix shell .

Typical
operations performed by shell scripts include file manipulation, program execution, and printing
text.
A
script
which
sets
up
the
environment,
runs
the
programme.
Type of shell
1. Bourne shell:- The Bourne shell, sh, was a complete rewrite by Stephen Bourne at Bell
Labs. Distributed as the shell for UNIX Version 7 in 1979, it introduced the rest of the
basic features considered common to all the Unix shells, including here
documents, command substitution, more generic variables and more extensive built
in control structures. The language, including the use of a reversed keyword to mark the
end of a block, was influenced by ALGOL 68.
2. Bourne-Again shell (bash): written as part of the GNU Project to provide a superset of
Bourne Shell functionality. This shell can be found installed and is the default interactive
shell for users on most GNU/Linux and Mac OS X systems.
3. Korn shell (ksh): written by David Korn based on the Bourne shell sources while working
at Bell Labs. It include Job control, command aliasing, and command history
4. Public domain Korn shell : -

its free and quite portable and mainly

used in ftp and http


5. C shell :- The C shell, csh, was written by Bill Joy while a graduate student
at University of California, Berkeley and widely distributed with BSD Unix.[4] The
language, including the control structures and the expression grammar, was modeled on
C. The C shell also introduced a large number of features for interactive work, including
the history and editing mechanisms, aliases, directory stacks, tilde notation, cdpath, job
control and path hashing

Editor of shell programing


Vi :- it is screen-oriented text editor. Now a days you would find an
improved version of vi editor which is called VIM. Here VIM stands
for Vi Improved
Command

Description

vi filename

Creates a new file if it already does not exist, otherwise opens


existing file.

vi -R filename

Opens an existing file in read only mode.

view filename

Opens an existing file in read only mode.

Operation Modes

While working with vi editor you would come across following two modes

Command mode This mode enables you to perform administrative tasks


such as saving files, executing commands, moving the cursor, cutting
(yanking) and pasting lines or words, and finding and replacing. In this
mode, whatever you type is interpreted as a command. Use

esc for

command mode

Insert mode This mode enables you to insert text into the file. Everything
that's typed in this mode is interpreted as input and finally it is put in the file
. Use i for using insert mode.

Command for vi

q! :- quit out of vi without saving


w

:-save the contents of the editor

wq : - write and quit

Basic of shell programming


Each and every command can be used in shell programming
echo "What is your name?"
read PERSON
echo "Hello, $PERSON"
echo is used for print the data
read is used for taking data from user
$ is used for showing the value which is stored in memory

You might also like