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

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

Shell Scripting with Scheme


Topic: Shell Programming

possible with Scheme. The focus of. this article is therefore on shell. programming as well as. programming for the Internet. Shell Scripting with Scheme ...

UNIX shell programming featuring korn shell u3711s


Topic: Shell Programming

UNIX shell programming featuring korn shell u3711s. course overview. This 3 day course is a basic user course. It is also the prerequisite for the UNIX ...

Unix POSIX Shell Programming - SVR4


Topic: Shell Programming

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

UNIX Systems Programming I


Topic: Shell Programming

... calls, the shell and other aspects of UNIX. ¥Unix For Programmers and Users, Graham Glass, Prentice-Hall, 1993, ISBN 0 13 061771 7 Slightly more recent book also covering shell and C programming. ...

 

Sponsored Links