Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Help to optimize script running time Post 302469132 by yahyaaa on Thursday 4th of November 2010 08:57:52 PM
Old 11-04-2010
Thank you Jim

Input data sample:

Zain500Disc;46464564;560;;0;0;Active;2011-02-04 22:59:00;0;1970-01-01 00:00:00;0;1970-01-01 00:00:00;0;1970-01-01 00:00:00;1970-01-01 00:00:00;2011-03-06 22:59:00;2011-06-05 22:59:00;TRUE;FALSE;0;0;0000;FALSE;TRUE;false;FALSE;0;true;0;true;true;TRUE;false;{00962795901649|00 962796371949|00962796859686|00962795293754|00962796859676};0;TRUE;{00963966107669};0;TRUE;{};0;TRUE; ;false;TRUE;FALSE;FALSE;2;FALSE;FALSE;;0;0;0;0;0;2;(FnF_1,-108,01.01.2025 23:59:59:999);(FnF_2,-108,01.01.2025 23:59:59:999);

ZainEazy;4646464;1;2000;0;0;Active;2016-09-10 22:59:00;0;2006-12-11 22:59:00;0;2009-05-26 22:59:00;0;1970-01-01 00:00:00;1970-01-01 00:00:00;2016-10-10 22:59:00;2017-01-09 22:59:00;TRUE;FALSE;0;0;0000;FALSE;TRUE;false;FALSE;0;true;0;true;true;TRUE;false;{};2;TRUE;{};0;TRU E;{};0;TRUE;;false;TRUE;FALSE;FALSE;2;FALSE;FALSE;;0;0;0;0;0;2;(FnF_1,-108,01.01.2025 23:59:59:999);

Jaishana;34535353;2776;;0;0;Active;2011-04-23 23:59:59;0;2006-03-07 23:59:00;0;2010-05-31 23:59:00;0;1970-01-01 00:00:00;1970-01-01 00:00:00;2011-05-23 23:59:59;2011-08-22 23:59:59;TRUE;FALSE;0;0;0000;FALSE;TRUE;false;FALSE;0;true;0;true;true;TRUE;false;{};2;TRUE;{};0;TRU E;{};0;TRUE;102;TRUE;TRUE;FALSE;FALSE;2;FALSE;FALSE;;0;0;0;0;0;2;(FnF_1,-108,01.01.2025 23:59:59:999);(CUG,-128,01.01.2025 00:00:00:000);

ZainQuattro;43534535;6406;4000;0;0;Active;2011-01-14 22:59:00;0;1970-01-01 00:00:00;0;2010-04-26 23:59:00;0;1970-01-01 00:00:00;1970-01-01 00:00:00;2011-02-13 22:59:00;2011-05-15 22:59:00;TRUE;FALSE;0;0;0000;FALSE;TRUE;false;FALSE;0;true;0;true;true;TRUE;false;{00962795500047|00 962795600207|00962799106309|00962795782960};0;TRUE;{00963941950270|00963947278825|00963966531175};0; TRUE;{};0;TRUE;;false;TRUE;FALSE;FALSE;2;FALSE;FALSE;;0;0;0;0;0;2;(FnF_1,-108,01.01.2025 23:59:59:999);(FnF_2,-108,01.01.2025 23:59:59:999);


This is a sample of input date, the program simply group lines and count them based on field number 1... field 1 is used as index for all arrays used..
it's in awk.... but I dont know why it's very slow, even it's fast somehow for low records !!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to compare latest logfile with the current running time of the script

how can i compare the latest log file with the current time.. consider i am running a script "a.sh" at 09:00 ( function of the script a.sh is to update the database ) this script is going to create logfile if the script is sucess in case of failure it is not going to create logfile.. ... (0 Replies)
Discussion started by: mail2sant
0 Replies

2. Shell Programming and Scripting

display time required to complete running script

hi is there any way i can display a countdown time needed to run a script? like load a counter at the beginning of the script with the estimated time and display the counter decrementing till it finishes running the script? (3 Replies)
Discussion started by: npatwardhan
3 Replies

3. Shell Programming and Scripting

Running batches of files at a time from a script

Hi I have a script that performs a process on a file. I want to know how to include a function to run a batch of files? Here is my script #!/bin/bash #---------------------------------------------------------------------------------------------------------------------- #This... (2 Replies)
Discussion started by: ladyAnne
2 Replies

4. Shell Programming and Scripting

Help in running a script after a particular time

Unix Gurus, I have a requirement where the shell script needs to do specific tasks after certain period of time. Daily we receive few files in a particular folder. The script does the file renaming, pass parameters to run some web services and pushes to remote FTP location. But my... (3 Replies)
Discussion started by: shankar1dada
3 Replies

5. Shell Programming and Scripting

How to know the exact running time of script!

Hi All, newbie here, I'm just wondering how can i know the exact running time of my script? Please advise, THanks, (1 Reply)
Discussion started by: nikki1200
1 Replies

6. Shell Programming and Scripting

Find the script running time and subtract from sleeptime

HI Guys, I want to find out the script running time and subtract from sleeptime. My Script Below Give me error :- #!/usr/bin/ksh timeout=100 start=$SECONDS sleep 20 end=$SECONDS echo "Time: $((end - start)) " ScTime = $((end - start)) (1 Reply)
Discussion started by: asavaliya
1 Replies

7. Shell Programming and Scripting

Setting time for running of the script

Dear all, I wonder if it is possible that we can run the script from time to time..I meant, it should repeat the sourcing of the script by itself? In my case, I need to source this script manually from time to time, like once in every 10 minutes. emily, (2 Replies)
Discussion started by: emily
2 Replies

8. Shell Programming and Scripting

Example of running script with time limits?

Hi, I want to write a script that does some sort of health check on the database. It will query the database for information, some query takes long and some are quick. For example, inside the script I will do something as below: #!/bin/ksh run_query_01 & run_query_02 &... (1 Reply)
Discussion started by: newbie_01
1 Replies

9. Shell Programming and Scripting

Kill long running script, if it crosses the threshold time

Hi, I need a script to kill the process if it running for long time. Inputs for the scripts: 1.test.sh (will be running fron cron scheduler) 2.1 hr (ie threshold_time - if the test.sh is running for more than 1 hr test.sh has to kill) Thanks, Divya (1 Reply)
Discussion started by: Divya Nochiyil
1 Replies

10. Shell Programming and Scripting

Killing the process if running for long time in script

I am running a script which will read the data from fail line by line and call the Java program by providing the arguments from the each line. The Java code is working fast for few records and for some records its getting hanged not providing response for morethan one hour. Currently am... (4 Replies)
Discussion started by: dineshaila
4 Replies
PROC_GET_STATUS(3)							 1							PROC_GET_STATUS(3)

proc_get_status - Get information about a process opened byproc_open(3)

SYNOPSIS
array proc_get_status (resource $process) DESCRIPTION
proc_get_status(3) fetches data about a process opened using proc_open(3). PARAMETERS
o $process - The proc_open(3) resource that will be evaluated. RETURN VALUES
An array of collected information on success, and FALSE on failure. The returned array contains the following elements: +---------+--------------------------------------+---+ |element | | | | | | | | | type | | | | | | | | description | | | | | | +---------+--------------------------------------+---+ |command | | | | | | | | | | | | | string | | | | | | | | The command string that was passed | | | | to proc_open(3). | | | | | | | pid | | | | | | | | | | | | | int | | | | | | | | process id | | | | | | |running | | | | | | | | | | | | | bool | | | | | | | | | | | | TRUE if the process is still run- | | | | ning, FALSE if it has terminated. | | | | | | |signaled | | | | | | | | | | | | | bool | | | | | | | | | | | | TRUE if the child process has been | | | | terminated by an uncaught signal. | | | | Always set to FALSE on Windows. | | | | | | |stopped | | | | | | | | | | | | | bool | | | | | | | | | | | | TRUE if the child process has been | | | | stopped by a signal. Always set to | | | | FALSE on Windows. | | | | | | |exitcode | | | | | | | | | | | | | int | | | | | | | | The exit code returned by the | | | | process (which is only meaningful if | | | | running is FALSE). Only first call | | | | of this function return real value, | | | | next calls return -1. | | | | | | |termsig | | | | | | | | | | | | | int | | | | | | | | The number of the signal that | | | | caused the child process to termi- | | | | nate its execution (only meaningful | | | | if signaled is TRUE). | | | | | | |stopsig | | | | | | | | | | | | | int | | | | | | | | The number of the signal that | | | | caused the child process to stop its | | | | execution (only meaningful if | | | | stopped is TRUE). | | | | | | +---------+--------------------------------------+---+ SEE ALSO
proc_open(3). PHP Documentation Group PROC_GET_STATUS(3)
All times are GMT -4. The time now is 10:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy