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

Korn Shell Script Writing


Topic: Shell Programming

A shell script is an executable file which is executed by the. shell linebyline. It can contain the following:. UNIX commands. shell programming ...

Korn Shell Script Writing


Topic: Shell Programming

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

Unix POSIX Shell Programming - SVR4


Topic: Shell Programming

Perform string manipulation and integer arithmetic on shell variables Unix POSIX Shell Programming - SVR4

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 ...

Windshield Windows Shell Script


Topic: Shell Programming

Windshield Windows Shell Script Columbia University COMS W4115 Programming Languages and Translators Spring 2007 Prof. Stephen A.

 

Sponsored Links