You can make your script a lot simpler by using more of the shell's own basic features. You can split input on fields in shell without the help of awk, sed, and tr. You can write to the same file 37 times instead of reopening the same files 37 times to append.
Also, why bother with all the pgrep stuff when you made yourself such a nicely formatted list of PID's to read?
Also, if we knew what your data looked like, we could probably streamline that awk / grep / awk / head / awk down into one awk call.
Last edited by Corona688; 09-12-2017 at 05:49 PM..
Reason: Fix IPADDR / IPADD typo
These 2 Users Gave Thanks to Corona688 For This Post:
Hi guys:
I have a an oracle job which uses 10 parallel hints and would like to killit when it hangs. I want to kill all the processes that have been spawned. what I do right now is get the pid of the scheduler process which initiated theis job and the do a ps -ef| grep 'pid' and trace through... (1 Reply)
Hi
I need to split a huge file into multiple smaller files using split command.
After that i need to process each file in the back ground with sql loader .Sql loader is a utlity to load CSV files into oracle .
Check the status of each of these sqlloaders and then after sucessfull... (6 Replies)
hi all,
i would like to write the shell script to monitoring the processing, but if i passing the parameter the number of process is incorrect
how to slove it? many thx
got the correct number of process as following script:
===========================================================... (3 Replies)
There is a unix process process in oracle running and i see running by typing ps -fea|grep GE_CLIENTES.
The question is How can i see if this process is running in paralel. I dont know with a Unix command or specifically its a comand from Oracle.
I kow a Parallel process ia a process that... (1 Reply)
I am a new member of this forum and am also new to unix shell scripting.
I joined the forum to seek for help to achieve my task as this forum helps people.
here's what i do manually on daily basis
1)Loginto different unix box
2)Ftp the log files (morethan 50 each dir) to windows
3)use text pad... (3 Replies)
I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time.
Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
HI All,
I have scenerio where I need to call sub modules through for loop
for (i=0; i<8000 ;i++)
{
..
BLOCKA
}
BLOCKA
{
..
..
subroutine 1;
subroutine 2;
}
I want this to be run in parallel
process1 BLOCKA
{ (6 Replies)
Hi,
I have a file which has a list of 200 tables e.g: table.txt
I need to do a count for each table and store it in a file.
So I did something like this:
for TABLE in `cat table.txt`
do
T_CNT=$(sqlplus -s -l / as sysdba <<EOF
set echo off heading off feadback off
SELECT count(*)
FROM... (1 Reply)
Discussion started by: wahi80
1 Replies
LEARN ABOUT POSIX
startpar
STARTPAR(8) System Manager's Manual STARTPAR(8)NAME
startpar - start runlevel scripts in parallel
SYNOPSIS
startpar [-p par] [-i iorate] [-t timeout] [-T global_timeout] [-a arg] prg1 prg2 ...
startpar [-p par] [-i iorate] [-t timeout] [-T global_timeout] -M [ boot|start|stop]
DESCRIPTION
startpar is used to run multiple run-level scripts in parallel. The degree of parallelism on one CPU can be set with the -p option, the
default is full parallelism. An argument to all of the scripts can be provided with the -a option. Processes blocked by pending I/O will
cause new process creation to be weighted by the iorate factor 800. To change this factor the option -i can be used to specify another
value. The amount weight=(nblockedxiorate)/1000 will be subtracted from the total number of processes which could be started, where
nblocked is the number of processes currently blocked by pending I/O.
The output of each script is buffered and written when the script exits, so output lines of different scripts won't mix. You can modify
this behaviour by setting a timeout.
The timeout set with the -t option is used as buffer timeout. If the output buffer of a script is not empty and the last output was timeout
seconds ago, startpar will flush the buffer.
The -T option timeout works more globally. If no output is printed for more than global_timeout seconds, startpar will flush the buffer of
the script with the oldest output. Afterwards it will only print output of this script until it is finished.
The -M option switches startpar into a make(1) like behaviour. This option takes three different arguments: boot, start, and stop for
reading .depend.boot or .depend.start or .depend.stop respectively in the directory /etc/init.d/. By scanning the boot and runlevel direc-
tories in /etc/init.d/ it then executes the appropriate scripts in parallel.
FILES
/etc/init.d/.depend.boot
/etc/init.d/.depend.start
/etc/init.d/.depend.stop
SEE ALSO init(8)insserv(8).
COPYRIGHT
2003,2004 SuSE Linux AG, Nuernberg, Germany.
2007 SuSE LINUX Products GmbH, Nuernberg, Germany.
AUTHOR
Michael Schroeder <mls@suse.de>
Takashi Iwai <tiwai@suse.de>
Werner Fink <werner@suse.de>
Jun 2003 STARTPAR(8)