Sponsored Links

 

 

 

Korn Shell Script Writing

Source: www.osc.edu
Topic: Shell Programming


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

 

Content Inside:
Korn Shell Script WritingPage 11Korn Shell Script WritingScience & Technology Support GroupHigh Performance ComputingOSC (Ohio Supercomputer Center)1224 Kinnear RoadColumbus OH 43212Page 22Basic 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 ExercisesPage 33Creating a Shell Script A shell script is an executable file which is executed by the shell linebyline. 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/shuses Bourne shell to execute script #!/bin/cshuses C shell to execute script etc... Page 44Executing a Shell ScriptThere are 3 ways to execute a shell script: 1."dot" method $ . scriptname2."just the name" method $ scriptname3.in the background$ scriptname &Page 55Executing 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 for scriptname chmod +x scriptname current directory (.) must be in PATH or else must use ./scriptnamePage 66Executing a Shell Script (cont.)cat list # a simple little shell scriptprint "A listing of $PWD " > list.outls l >> list.out For methods 2 and 3 the shell runs another copy of itself as a subprocess. Pictorially the difference between Methods 1 2 and 3 is: Page 77Functions Improves shell's programmability already in memory (unless autoloaded) modular programing Syntax: function functname {shell commands}orfunctname (){shell commands}Page 88Functions (cont.) Delete a function definition with $ unset f functname Display all defined functions: $ functionsPage 99Functions (cont.) Two important differences between functions and she ...

 

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

Unix Programming Tools


Topic: Shell Programming

Unix Programming Tools By Parlante, Zelenski, and many others Copyright ©1998 ... link-debug programming cycle and introduces several common Unix programming tools -- gcc, make, gdb, emacs, and the Unix shell.

Bash Style Guide and Coding Standard


Topic: Shell Programming

... of the shell and the system utilities. Occasionallytechnical journals publish articleson shell programming. ... Advanced Bash-Scripting Guide. http://www.tldp.org/LDP/abs/html/, 2006. Comprehensive tutorial ...

UNIX System Programming


Topic: Shell Programming

UNIX System Programming Lecture 4 BASH Shell Programming BLP: Chapter 2 BABS Outline: Redirection ... zsh, ksh Change your default shell to bash $ chsh -s /bin/bash 2 Our First Shell Script A ...

The ArtofUnix Programming Teaching Guide byEric Steven Raymond by Rob ...


Topic: Shell Programming

How touse this guide The ArtOfUnix Programming (TAOUP) was written primarily to be used as a self ... of Unix tutorials, which tend to concentrate on the level of basic shell usage, application programming ...

CU003 - UNIX Korn Shell Programming Length: 5 Days


Topic: Shell Programming

... to improve shell program efficiency and detect and correct errors • Develop a user interface menu system using shell programming constructs Course Materials UNIX Korn Shell Programming Student Guide ...

 

Sponsored Links