shell script [email protected]@rockfortnetworks.com

11
Shell script www.rockfortnetworks.com [email protected]

Upload: liliana-phelps

Post on 12-Jan-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

Shell script

www.rockfortnetworks.com [email protected]

Page 2: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

About shell script A shell script is a computer program designed to be run by the Unix shell, a command line interpreter.[1] The various dialects of shell scripts are considered to be scripting languages. Shell scripts allow several commands that would be entered manually at a command-line interface to be executed automatically, and without having to wait for a user to trigger each stage of the sequence. For example, in a directory with three . source code files. Simple batch jobs are not unusual for isolated tasks, but using shell loops, tests, and variables provides much more flexibility to users. A Bash (Unix shell) script to convert JPEG images to PNG images, typically saved in a file like /home/username/bin/jpg2png

Page 3: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

A key feature of shell scripts is that the invocation of their interpreters is handled as a core operating system feature. So rather than a user's shell only being able to execute scripts in that shell's language, or a script only having its interpreter directive handled correctly if it was run from a shell (both of which were limitations in the early Bourne shell's handling of scripts), shell scripts are set up and executed by the OS itself. Many modern shells also supply various features usually found only in more sophisticated general-purpose programming languages, such as control-flow constructs, variables, comments, arrays, subroutine and so on. With these sorts of features available, it is possible to write reasonably sophisticated applications as shell scripts. Shell scripts often serve as an initial stage in software development, and are often subject to conversion later to a different underlying implementation, most commonly being converted to Perl, Python, or C.   

Page 4: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

Architecture diagram of Unix shell script

Page 5: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

Different types of shell script

1. Unix shell :- A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. The most influential Unix shells have been the Bourne shell and the C shell. These shells have both been used as the coding base and model for many derivative and work-alike shells with extended feature sets. Users typically interact with a Unix shell using a terminal emulator.

Page 6: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

2.Bourne shell:- The Bourne shell was one of the major shells used in early versions of the Unix operating system and became a de facto standard. It was written by Stephen R. Bourne at Bell Labs and was first distributed with Version 7 Unix, circa 1977. The POSIX standard specifies its standard shell as a strict subset of the Korn shell, an enhanced version of the Bourne shell. From a user's perspective the Bourne shell was immediately recognized when active by its characteristic default command line prompt character, the dollar sign ($).

Page 7: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

3.C shell :- The C shell was developed by Bill Joy for the Berkeley Software Distribution (BSD), a line of Unix operating systems derived from Unix and developed at the University of California, Berkeley. It was originally derived from the 6th Edition Unix shell (Thompson shell), with its syntax modeled after the C programming language. The C shell is used primarily for interactive terminal use, and less frequently for scripting and operating system control. It has interactive keyboard shortcuts in form of special control-key sequences for special effects such as job control.

Page 8: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

Features of shell script Perhaps the biggest advantage of writing a shell script is that the commands and syntax are exactly the same as those directly entered at the command line.  writing a shell script is much quicker than writing the equivalent code in other programming languages.    Interpretive running makes it easy to write debugging code into a script and re-run it to detect and fix bugs.  Non-expert users can use scripting to tailor the behavior of programs, and shell scripting provides some limited scope for multiprocessing.   This is made more problematic by the fact that many UNIX commands differ in name by only one letter: cp, cd, dd, df, etc.

Page 10: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

Salient features of shell script :

80% hands on / practical classes. Real time Scenarios / Project Exposure. Limited no of students per batch. Corporate Training Atmosphere Week end Batches to suit Professional. Placement Assistance which includes1. Resume Preparation 2. Individual Counselling3. Offline Support, which includes email queries and assignments.4. Association with people who are working for

more than 20 Companies who may provide interviews . Backup Classes. Provision to come for one more batch.

Page 11: Shell script  shellscript.bng@rockfortnetworks.comshellscript.bng@rockfortnetworks.com

Platinum features of shell script Will get complete product development cycle, which includeso Demand from customer.o Design-decision.o Conceptualization.o Analysis.o Design finalize.o DFMEA.o Finalization.o Drawing release.o Tool design.o Product to the market.