Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Ab Initio, Unix Scripting, and Datawarehousing

RE: Ab Initio, Unix Scripting, and Datawarehousing

From: Stephen Lee <Stephen.Lee_at_DTAG.Com>
Date: Wed, 19 Mar 2003 11:38:00 -0600
Message-Id: <24715.322402@fatcity.com>


> -----Original Message-----
> 2. What is a good Unix scripting book for Oracle Developers?

There is more than one good scripting language for Unix. I suspect others with chime in with Perl, Python, etc.; so I'll throw in some comments on Korn shell programming. If you want a good book for ksh programming -- and I have recommended this book before -- I like:

Unix System V
A Practical Guide
by Mark G. Sobell
ISBN 0-8053-7566-X Chapters 10 and 12 cover the Bourne and Korn shell (C shell is chapter 11). The two chapters together will cover about everything you need to know about ksh scripting. Keep in mind that there is (IIRC) a ksh88 and ksh93. This book presents the additional text processing capabilities of ksh93 that are not in ksh88. If you are using a Linux distribution, the ksh that comes with it is probably crap, to the point of being unusable for any kind of scripting. You can download and compile ksh93 for Linux on Intel. The Linux propellerheads would rather you use bash (Bourne Again Shell) which is a perfectly good shell for scripting. This book does not cover bash.

In order to talk to an Oracle database with ksh, you will need to look at using "here documents" and/or using the ksh coprocess; both are covered in the book. The book covers some of the other auxilary things you need to learn such as Regular Expressions, which are the rules for pattern matching when processing text. These rules are not just unique to ksh programming, but are used by most Unix utilities that process text. Like it or not, you will NEED to learn regular expressions if you are doing Unix scripting. The book gives you an introduction to Sed and Awk which are the two main text processing utilities, but to get serious with Sed and Awk, you should get the O'Reilly book for those.

The book gives an intro to make and makefiles; it covers version control utilities such as RCS; and it covers the most common Unix commands that you will use. The back of the book has a section of "man pages" for a lot of the Unix utilities. There are chapters on the vi and emacs text editors.

I don't think the book has been updated since about 1995, so it discusses a few obsolete things, such as archie and gopher, which you can ignore.

If you work with Unix, I consider this book to be one of the absolutely essential books that you should have, even if you don't plan on doing ksh programming.

Korn shell has good programming capability, but I have identified two limitations you might want to consider.

  1. It does not support a two-way socket connection to a child process. You can send to the process or you can received from the process, but interacting with the child process in anything like a full duplex communication can't be done.
  2. You can't open and read a file at a low level (for example, a byte at a time). Most of the utilities used for file processing that you would use with ksh are line-driven utilities. That is, they expect to process text a line at a time. If you must read a file that is just one big gob of text (i.e. no new lines) rather than lines of text (or whatever), you might have some difficulties with ksh.

In spite of these limitations, ksh is easy to learn (I think), and as long as you avoid some of the ksh syntactical candy and keep the syntax looking Bourne shell-ish (Bourne shell is a "subset" of Korn shell), ksh programs are very easy to read. Korn shell supports modular programming with Received on Wed Mar 19 2003 - 11:38:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US