Auto Manual Online

Sponsored Links

 

 

 

Korn Shell Script Writing

Source: www.osc.edu
Topic: Shell Programming


Short Desciption:
2 Basic Shell Programming • Creating a Shell Script • Executing a Shell Script • Functions • Precedence of Commands • eval • Shell Variables • Assigning Variable Names • • ...

 

Content Inside:
1 Korn Shell Script Writing Science & Technology Support Group High Performance Computing OSC (Ohio Supercomputer Center) 1224 Kinnear Road Columbus, OH  43212 2 Basic Shell Programming • Creating a Shell Script • Executing a Shell Script • Functions • Precedence of Commands • eval • Shell Variables • Assigning Variable Names • • Null Variables • Special Shell Variables • Parameter Substitution • Special Pattern Matching Features • Command Substitution • Exercises 3 Creating a Shell Script • A shell script is an executable file which is executed by the shell line-by-line. It can contain the following: -UNIX commands -shell programming statements -comments • Create using editor of choice • Can include a #! construct in first line of script to override login shell -#!/bin/sh usesBourneshell to execute script -#!/bin/csh uses C shell to execute script -etc. 4 Executing a Shell Script There are 3 ways to execute a shell script: 1."dot"  method $. scriptname 2."just the name" method $scriptname 3.in the background $scriptname& 5 Executing a Shell Script (cont.) • Method 1 runs the command as if you typed them in on the command line • Note that methods 2 and 3 require: -execute permission forscriptname chmod+xscriptname -current directory (.) must be in PATH or else must use ./scriptname 6 Executing a Shell Script (cont.) cat list #asimplelittle shell script print "Alistingof$PWD ">list.out ls-l>>list.out • For methods 2 and 3 the shell runs another copy of itself as asubprocess. Pictorially, the difference between Methods 1, 2, and 3 is: 7 Functions • Improves shells programmability -already in memory (unlessautoloaded) -modular programing • Syntax: function functname{ shell commands } or, functname () { shell commands } 8 Functions (cont.) • Delete a function definition wi ...

 

add to Google Reader add to Google Bookmark add to bloglines add to newsgator add to FURL add to digg add to webnews add to Netscape add to Yahoo MyWeb add to spurl.net add to diigo Bookmark newsvine Bookmark del.icio.us Bookmark @ SIMPIFY Bookmark MISTER WONG Bookmark Linkarena Bookmark icio.de Bookmark oneview Bookmark folkd.com Bookmark yigg.de Bookmark reddit Bookmark StumbleUpon Bookmark Slashdot Bookmark blinklist Bookmark technorati add to blogmarks add to blinkbits add to ma.gnolia add to smarking.com add to netvouz add to co.mments add to Connotea add to de.lirio.us

 

Related PDF Files

SHELL PROGRAMMING


Topic: Shell Programming

SHELL PROGRAMMING (G610) Course Description This course is designed for system administrators ... the different command types on the system • Write a basic batch-file shell script ...

basic shell programming


Topic: Shell Programming

bash derives much of its programming functionality from shell variables. Weve ... builtin variables that are vital to shell programming. ...

Unix POSIX Shell Programming SVR4


Topic: Shell Programming

Unix POSIX (Korn) Shell Programming SVR4. Course Outline. UNIX Shells and Shell Scripts. Describe the role of shells in the UNIX environment ...

Advanced UNIX Shell Scripting Workshop


Topic: Shell Programming

... want to increase their productivity by taking advantage of Korn shell features in business applications. Prerequisites: Introduction to UNIX for Applications Developers or UNIX Shell Programming or ...

Win32 Shell Scripting Tutorial


Topic: Shell Programming

Batch files are used to automate repetitive command sequences in the command shell environment. In the context of batch programming the environment is ...

 

Sponsored Links