Multi-threading in Unix using shell scripts

Multi-threading can be accomplished at many levels

- Separate stages that run parallel to each other, in Concurrent Manager request sets
- Using DBMS_JOB.SUBMIT at the database level
- Compiled Pro*C files (Oracle does this with PYUGEN for example)
- Unix background processes
- Scripting language such as Perl
- Java
- JSP
- etc

However, in the wise words of someone else I know, sometimes the simpliest answer achieves the desired goal. Shell Scripts, when you get down to it, are pretty simple. No real complex logic in most cases.

Pages: 1 · 2

HANDY ONE-LINERS FOR SED (Unix stream editor)

See AWK also, which is often a companion to SED.

HANDY ONE-LINERS FOR SED (Unix stream editor) Apr. 26, 2004 compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.4

Latest version of this file is usually at: http://sed.sourceforge.net/sed1line.txt

TYPICAL USE: Sed takes one or more editing commands and applies all of them, in sequence, to each line of input. After all the commands have been applied to the first input line, that line is output and a second input line is taken for processing, and the cycle repeats. The preceding examples assume that input comes from the standard input device (i.e, the console, normally this will be piped input). One or more filenames can be appended to the command line if the input does not come from stdin. Output is sent to stdout (the screen). Thus:

 cat filename | sed '10q'        # uses piped input
 sed '10q' filename              # same effect, avoids a useless "cat"
 sed '10q' filename > newfile    # redirects output to disk


Pages: 1 · 2 · 3

HANDY ONE-LINERS FOR AWK

See SED also, which is often a companion to AWK.

HANDY ONE-LINERS FOR AWK 22 July 2003 compiled by Eric Pement version 0.22

Latest version of this file is usually at: http://www.student.northpark.edu/pemente/awk/awk1line.txt

Most of my experience comes from version of GNU awk (gawk) compiled for Win32. Note in particular that DJGPP compilations permit the awk script to follow Unix quoting syntax '/like/ {"this"}'.

However, the user must know that single quotes under DOS/Windows do not protect the redirection arrows ( ) nor do they protect pipes (|). Both are special symbols for the DOS/CMD command shell and their special meaning is ignored only if they are placed within "double quotes."

Likewise, DOS/Win users must remember that the percent sign (%) is used to mark DOS/Win environment variables, so it must be doubled (%%) to yield a single percent sign visible to awk.

If I am sure that a script will NOT need to be quoted in Unix, DOS, or CMD, then I normally omit the quote marks. If an example is peculiar to GNU awk, the command 'gawk' will be used.

Please notify me if you find errors or new commands to add to this list (total length under 65 characters). I usually try to put the shortest script first.

USAGE:

    Unix:  awk '/pattern/ {print "$1"}'    # standard Unix shells
 DOS/Win:  awk '/pattern/ {print "$1"}'    # okay for DJGPP compiled
           awk "/pattern/ {print \"$1\"}"  # required for Mingw32

Pages: 1 · 2

Email Files Script for OraApps

We ran into a situation where we needed to email encrypted zip files to a client generated from reports. Using the Oracle Applications as a platform for entering the parms, I created a simple approach to fulfilling this requirement. It could be expanded to support PGP, Mime attachments, etc. However, it works as is. To see the setup of job and shell script, click the Read More link below.

Pages: 1 · 2