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

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 Shell Programming


Topic: Shell Programming

... Options to the ps Utility Background Commands (&) Killing Background Processes Redirecting the Standard Error Shell Programming Concepts What is a Shell? What is a Shell Script? Why Use ...

Bourne Shell Programming in One Hour


Topic: Shell Programming

Shell programming is also different from conven. tional programming languages. For example the. shell itself doesnt provide much useful functionality; ...

Shell Scripting


Topic: Shell Programming

Why Shell Script? Its the simplest form of programming. Shell scripting is exactly the same as. you use with an interactive shell session. ...

Shell Programming QuickStart


Topic: Shell Programming

Shell Programming. QuickStart. 2.1 Taking a Peek at Shell Scripts ... Chapter 2 Shell Programming QuickStart. Before Getting Started. ...

 

Sponsored Links