You are on page 1of 18

1

T ERM PAPER
OF
LINUX
PROGRAMMING

TOPIC:- Shells for linux (Details of specification


&services of different old &new shell interfaces
of linux)

SUBMITTED BY
SUBMITTED TO
NAME- BITTU KUMAR LECT. KIRAN
KUMAR KAKI

SECTION-E2801 (DEPARTMENT
OF COMPUTER SC.)

ROLL NO. – 46
2

REGISTRATION NO. -10808479


3

ACKNOWLEDGEMENT
As usual a large number of people deserve my thanks for the
help they provided me for the preparation of this term paper.

First of all I would like to thank my teacher MR. Kiran sir


for her support during the preparation of this topic. I am
very thankful for her guidance.

I would also like to thank my friends for the encouragement


and information about the topic they provided to me during
my efforts to prepare this topic.

At last but not the least I would like to thank seniors for
providing me their experience and being with me during my
work.
4

CONTENTS

1. INTRODUCTION

2. WHAT’S LINUX SHELL

3. GETTING TO A LINUX SHELL

4. GETTING TO A LINUX SHELL

5. VARIETY OF SHELL

6. USE OF SHELL

7. REFERENCES
5

1.INTRODUCTION
The Linux/Unix shell refers to a special program that allows you to interact with
it by entering certain commands from the keyboard; the shell will execute the
commands and display its output on the monitor. The environment of
interaction is text-based (unlike the GUI-based interaction we have been using
in the previous chapters) and since it is command-oriented this type of interface
is termed Command Line interface or CLI. Before the advent of GUI based
computing environments, the CLI was the only way that one can interact and
access a computer system.

2. WHAT’S LINUX SHELL


Computer understand the language of 0's and 1's called binary language, In
early days of computing, instruction are provided using binary language, which
is difficult for all of us, to read and write. So in O/s there is special program
called Shell. Shell accepts your instruction or commands in English and
translate it into computers native binary language.

This is what Shell Does for US

You type Your command and shell convert it as


6

It's environment provided for user interaction. Shell is an command language


interpreter that executes commands read from the standard input device
(keyboard) or from a file. Linux may use one of the following most popular
shells (In MS-DOS, Shell name is COMMAND.COM which is also used for
same purpose, but it's not as powerful as our Linux Shells are!)

3. GETTING TO A SHELL
Since it is most likely that you are in the graphical desktop environment now,
the underlying shell that is available is not displayed. To access a shell, try the
following key combination, Control + Alt + F1Where F1 can be replaced by F2,
F3, and so on. The graphical desktop tends to run in F7 or F8, so to go back to
your graphical desktop screen, just hit Control + Alt + F7.These are virtual
terminals. Alternatively, you could get to a Terminal application, so you can
have a shell while your in the graphical desktop
Environment (this is much preferred, and will be used throughout this Chapter).
To do this, go to: Main Menu --> System Tools --> Terminal Or right-click on
the desktop, and click on the Open Terminal option. This terminal is equivalent
to the virtual terminals mentioned earlier, except now you don't have to switch
screens – you can just minimize or maximize the
Terminal (or if you're done, you can close it).

4. VARIETY OF SHELL
The MS-DOS shell has been fairly consistent over time; for example, the
differences between MS-DOS v3 and MS-DOS v7 are few. The Unix shell,
however, has experienced significantly more evolutionary development than
MS-DOS. Today, you find both versions and variants of the Unix shell. The
Unix shell variants have much in common, but each has a different authorship
7

and history, and each reflects a different view of how users should interact with
Unix

Linux includes the most popular Unix shells, as shown in Table . The most
popular Linux shell is the BASH shell (the "Bourne Again Shell"), based on the
original Unix Bourne shell. The BASH shell is largely compliant with the
POSIX standard, which specifies the syntax and operation of a standard UNIX
shell and which has been widely implemented. Because of the popularity of the
POSIX standard and the obvious advantage of working with a shell that's
consistent across a variety of computing platforms, this chapter focuses on the
BASH shell. Most Linux systems are configured to automatically start a BASH
shell on your behalf when you log in; so, you don't generally need to be much
concerned about choosing a shell.

a) .sh: The Bourne shell, or sh, was the default Unix shell of
Unix Version 7, and replaced the Thompson shell, whose executable file
had the same name, sh. It was developed by Stephen Bourne, of AT&T
Bell Laboratories, and was released in 1977 in the Version 7 Unix
release distributed to colleges and universities. It remains a popular
default shell for Unix accounts. The binary program of the Bourne shell
or acompatible program is located at /bin/sh on most Unix systems ,and
is still the default shell for the root superuser on many current Unix
implementations.
8

b). ash: The Almquist shell (also known as A Shell or ash) was
originally Kenneth Almquist’s clone of the SVR4-variant of the Bourne shell;
it is a fast, small, POSIX-compatible Unix shell designed to replace the
Bourne shell in later BSD distributions. By intention it did not feature line
editing or command history mechanisms originally, because Almquist felt
that such should be moved into the terminal driver. Current variants have
emacs and vi modes.
9

c). dash: Debian Almquist shell (dash) is a POSIX-compliant


UNIX shell, much smaller than bash. It requires less disk space but is also
less feature rich. dash is a direct descendant of the Net BSD version of the
Almquist Shell (ash). It was ported to Linux by Herbert Xu in early 1997. It
was renamed to dash in 2002.dash executes scripts faster than bash and
depends on fewer libraries. It is believed to be more reliable in case of
upgrade problems or disk failures.

d). bash: Bash is a UNIX shell written for the GNU Project. The
name of the actual executable is bash. Its name is an acronym for Bourne-
again shell, a pun on the name of the Bourne shell (sh) (i.e. “Bourne again” or
“born again”), an early and important Unix shell written by Stephen Bourne
10

and distributed with Version 7 Unix circa 1978. Bash was created in 1987 by
Brian Fox. In 1990 Chet Ramey became the primary maintainer. Bash is the
default shell on most Linux systems as well as on Mac OS X and it can be
run on most Unix-like operating systems.

e). fish: fish is a Unix shell. Its name is an acronym for friendly
interactive shell. fish focuses on interactive use, discoverability, and user
friendliness. The design goal of fish is to give the user a rich set of powerful
features in a way that is easy to discover, remember, and use.
11

f). ksh: The Korn shell (ksh) is a UNIX shell which was
developed by David Korn (AT&T Bell Laboratories) in the early 1980s. It is
backwards compatible with the Bourne shell and includes many features of
the C shell as well, such as a command history, which was inspired by the
requests of Bell Labs users. The main advantage of ksh over the traditional
Unix shell is in its use as a programming language. Since its conception,
several features were gradually added, while maintaining strong backwards
compatibility with the Bourne shell.
12

g). csh: The C shell (csh) is a Unix shell developed by Bill Joy for
the BSD Unix system. It was originally derived from the 6th Edition Unix
/bin/sh (which was the Thompson shell), the predecessor of the Bourne shell.
Its syntax is modeled after the C programming language. The C shell added
many feature improvements over the Bourne shell, such as aliases and
command history. Today, the original C shell is not in wide use on Unix; it
has been superseded by other shells such as the Tenex C shell (tcsh) based on
the original C shell code, but adding filename completion and command line
editing, comparable with the Korn shell (ksh), and the GNU Bourne-Again
shell (bash).
13

h). tcsh: tcsh (pronounced “TC-Shell” or “T-shell”) is a Unix


shell based on and compatible with the C shell (csh). It is essentially the C
shell with (programmable) filename completion, command-line editing,
and a few other features.
14

i). es: The es shell is a command line interpreter that uses a


scripting language similar to the rc shell. It is intended to provide a fully
functional programming language as a Unix shell. The bulk of es’
development occurred in the early 1990s. Unlike other modern shells, es
does not have job control. Patches to provide job control have been
offered, but the currently available ones have memory leak problems.
15

j). rc: rc is the command line interpreter for Version 10 Unix, Plan 9,
and Inferno operating systems. It resembles the Bourne shell, but its syntax is
somewhat simpler. It was created by Tom Duff, who is better known for an
unusual C programming language construct called Duff’s device.

k). scsh: Scsh is a POSIX API layered on top of the Scheme


programming language (currently only a Scheme 48 implementation
exists, but others are planned) in a manner to make the most of scheme’s
capability for scripting. It is limited to 32-bit platforms.

l). sash: Stand-alone shell (sash) is a Unix shell designed for


use in recovering from certain types of system failures. The built in
commands of sash have all libraries linked statically, so unlike most
shells, the standard UNIX commands do not rely on external libraries. For
16

example the copy command (cp) requires linux-gate.so, libc.so, and ld-
linux.so when built from GNU coreutils on Linux. If any of these libraries
get corrupted, the coreutils cp command would not work, however in sash,
the built-in command, cp, would be unaffected.

m). zsh: The Z shell (zsh) is a Unix shell that can be used as
an interactive login shell and as a powerful command interpreter for shell
scripting. Zsh can be thought of as an extended bourne shell with a large
number of improvements, including some of the most useful features of
bash, ksh, and tcsh.
17

5. USE OF SHELL:-
While it's true that the shell is an older style of interacting with a computer than
the graphical user interface, the graphical user interface is actually the more
primitive interface. The graphical user interface is easy to learn and widely
used, but the shell is vastly more sophisticated. Using a graphical user interface
is somewhat like communicating in American Indian sign language. If your
message is a simple one, like "we come in peace," you can communicate it by
using a few gestures. However, if you attempted to give Lincoln's Gettysburg
address - a notably short public discourse - by means of American Indian sign
language, you'd find your task quite formidable.

American Sign Language, used to communicate with those who have a hearing
impairment, is a much richer language than American Indian sign language.
Unfortunately, programmers have not yet risen to the challenge of creating
graphical user interfaces that are equally sophisticated. The designer of a
program that provides a graphical user interface must anticipate all the possible
ways in which the user will interact with the program and provide ways to
trigger the appropriate program responses by means of pointing and clicking.
Consequently, the user is constrained to working only in predicted ways. The
user is therefore unable to adapt the graphical user interface program to
accommodate unforeseen tasks and circumstances. In a nutshell, that's why
many system administration tasks are performed using the shell: system
administrators, in fulfilling their responsibility to keep a system up and running,
must continually deal with and overcome the unforeseen.
18

The shell reflects the underlying philosophy of Unix, which provides a wide
variety of small, simple tools (that is, programs), each performing a single task.
When a complex operation is needed, the tools work together to accomplish the
complex operation as a series of simple operations, one step at a time. Many
Unix tools manipulate text and, since Unix stores its configuration data in text
form rather than in binary form, the tools are ideally suited for manipulating
Unix itself. The shell's ability to freely combine tools in novel ways is what
makes Unix powerful and sophisticated. Moreover, as you'll learn, the shell is
extensible: You can create shell scripts that let you store a series of commands
for later execution, saving you the future tedium of typing or pointing and
clicking to recall them.

6. REFERENCES:-

1. BEGINNNIG TO LINUX PROGRAMMING


2. ARTITECTURE LINUX
3. SOFTPEDIA.COM

You might also like