02-14-2008
Korn Shell Best Practices
I am new to ksh scripts (still reading manuals). I need to write an application that reads a multi-line parameter file, builds sql on-the-fly, runs plsql and saves the output in a specific format for further processing. I am looking for anything on Best Practices for building such an application. How best to organize it, sub-divide it, test it, down to how best to format the code for clarity. Any book or white paper suggestions would be appreciated.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi I am new to shell programming. I need help to write a script to monitor a process on Sun OS. If the process fails then call a oracle procedure.
i check the process if running by typing
ps -ef | grep ESP | grep -v grep
root 29002 1 0 Mar 18 ? 7:20... (4 Replies)
Discussion started by: gpanesar
4 Replies
2. Shell Programming and Scripting
I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server..
I have seen some code that may help - but I cant get it working as below:
spawn /usr/bin/ksh
send "telnet x <port_no>\r"
expect "Enter command: "
send "LOGIN:x:x;... (2 Replies)
Discussion started by: frustrated1
2 Replies
3. Shell Programming and Scripting
well i have this code here..and it works fine in kornshell..
#!/bin/ksh
home=c:/..../
input=$1
sed '1,3d' $input > $1.out
line=""
cat $1.out | while read a
do
line="$line $a"
done
echo $line > $1
rm $1.out
however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have a script that uses "nohup" command to execute a korn shell script. Which one is the correct shell to use bourne shell or korn shell to execute a korn shell? and why?
Thanks in advanced. (2 Replies)
Discussion started by: XZOR
2 Replies
5. UNIX for Dummies Questions & Answers
I am doing this simple script using c shell and korn shell. The commands I use are fgrep , ls, and also some redirecting. Is there any difference in using both of these commands in c shell and korn shell? Thanks and sorry for the stupid question. (1 Reply)
Discussion started by: EquinoX
1 Replies
6. Shell Programming and Scripting
I know there is a command called trap which can be used to capture the signals from a shell script and redirect the control to a required function (such as a cleanup).
My question is - Those of you who have written lot of shell scripts - do you always write a set of trap commands to capture... (4 Replies)
Discussion started by: sagar_evc
4 Replies
7. Shell Programming and Scripting
I am using korn shell but I want to have my prompt to represnent that of my C shell because I like it better. Is there anyway to do this? (1 Reply)
Discussion started by: vthokiefan
1 Replies
8. Shell Programming and Scripting
Hi All
I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell.
Some operations like calculation don't work :
cat ${file1} | tail -$((${num1}-${num2})) > ${file2}
Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies
9. Shell Programming and Scripting
Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command ..
$ echo $SHELL
yields me
/bin/sh
Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies
10. Shell Programming and Scripting
I am new to korn shell and slowly learning. Is there a way to have a parent script prompt for input and then execute a child script and return the output then move forward and ask for more input and then execute the next child script? I think the answer is no but thought i would ask. (2 Replies)
Discussion started by: cptkirkh
2 Replies
USE(1) User Commands USE(1)
NAME
use - Frontend to the Usepackage Environment Manager
SYNOPSIS
csh and derivatives:
source /usr/share/usepackage/use.csh
bourne shell and derivatives:
source /usr/share/usepackage/use.bsh
korn shell:
. /usr/share/usepackage/use.ksh
use [-vs] [-f file] package ...
use -l
DESCRIPTION
Usepackage is an environment management program. It is based on the principle of packages - collections of executables that share a common
set of necessary environment variables, such as PATH, MANPATH or LD_LIBRARY_PATH.
For each given package, use sources the appropriate environment information into the current shell. The environment information is speci-
fied in a configuration file, see usepackage(1).
OPTIONS
-v Output verbose information to the standard error stream.
-s Silence warnings for un-matched packages. This is useful in a shell rc script when a package is known not to be available on all
architectures that the shell is used on.
-f file
Specify an alternate initial configuration file.
-l List available packages and groups.
FILES
/usr/share/usepackage/usepackage.conf
The default configuration file.
/usr/share/usepackage/use.csh
Shell setup for csh and derivatives.
/usr/share/usepackage/use.bsh
Shell setup for bourne shell and derivatives.
/usr/share/usepackage/use.ksh
Shell setup for ksh.
/usr/bin/usepackage
The underlying Usepackage executable.
ENVIRONMENT
Other than the reading and re-definition of environment variables for package setup, use also uses the following environment variables for
user configuration:
PACKAGES_PATH Colon-separated path list giving the directories to search for configuration files. Shell-style tilde (~) user-directory
escapes are expanded.
HOME If present in the environment, this is used to provide the expansion for the tilde (~) user-directory.
SHELL If present in the environment, the last path component of this is used for shell matching (see SYNTAX) and detecting the
style of environment output that should be used, see usepackage(1).
COPYRIGHT
Usepackage Environment Manager
Copyright (C) 1995-2005 Jonathan Hogg
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER-
CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
SEE ALSO
usepackage(1), csh(1), sh(1), ksh(1)
Usepackage $Date: 2005/12/11 16:42:09 $ USE(1)