To reduce execution time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To reduce execution time
# 1  
Old 05-12-2008
To reduce execution time

Hi All,

The below script I run daily and it consumes 2 hours approx.
In this I am calling another script and executing the same twice.
Is the loop below the cause for the slow process?Is it possible to finetune the program so that it runs in a much faster way?

The first script:
Code:
#!/bin/ksh

for file in 1 2
do
echo "Started on `date`" | tee -a secondscript.log
secondscript.sh   2>&1| tee -a secondscript.log
echo "Ended on `date`" | tee -a secondscript.log
done

Second script contains hundreds of compilation statements(Those are error free).

Last edited by Sreejith_VK; 05-13-2008 at 01:05 AM..
Sreejith_VK
# 2  
Old 05-12-2008
Nothing wrong with your loop.
It will be what you are doing in the 'secondscript.sh'.
Being that you are executing hundreds of compilation statements, then it might be reasonable that it takes a while.
Are you able to post the contents of the 'secondscript.sh' ??

Cheers,
Cameron

p.s. - Need to drop or qualify "$dayext" in your script too.

Last edited by Cameron; 05-12-2008 at 09:51 PM.. Reason: $dayext notation.
# 3  
Old 05-13-2008
Thanks Cameron for your clarification.
Sreejith_VK
# 4  
Old 05-13-2008
Removed duplicate post

Last edited by Sreejith_VK; 05-13-2008 at 04:09 AM.. Reason: Removed duplicate post
Sreejith_VK
# 5  
Old 05-13-2008
Removed duplicate post

Last edited by Sreejith_VK; 05-13-2008 at 04:09 AM.. Reason: Removed duplicate post
Sreejith_VK
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to reduce the execution time

We are trying to execute below script for finding out the occurrence of a particular word in a log file Need suggestions to optimize the script. Test.log size - Approx to 500 to 600 MB $wc -l Test.log 16609852 Test.log po_numbers - 11 to 12k po's to search $more po_numbers xxx1335... (10 Replies)
Discussion started by: KumarPiyush7225
10 Replies

2. Shell Programming and Scripting

Optimizing script to reduce execution time

AFILENAME=glow.sh FILENAME="/${AFILENAME}" WIDTHA=$(echo ${FILENAME} | wc -c) NTIME=0 RESULTS=$(for eachletter in $(echo ${FILENAME} | fold -w 1) do WIDTHTIMES=$(awk "BEGIN{printf... (5 Replies)
Discussion started by: SkySmart
5 Replies

3. Shell Programming and Scripting

Help to reduce time of archiving

hi all, i have written the following script that does this work: 1. copy large logs files from one server to another. 2. then unzip this files and extraxt from these large https logs only those fields that are neccesary. 3. then archive the extracted logs to new files. BUT the problem is... (7 Replies)
Discussion started by: arrals_vl
7 Replies

4. Shell Programming and Scripting

Automation script to reduce the installation time

DELETED. (0 Replies)
Discussion started by: vasuvv
0 Replies

5. UNIX for Dummies Questions & Answers

time taken for execution

how much time a particular command or shell script executed there is any command to know this thanks (5 Replies)
Discussion started by: tsurendra
5 Replies

6. Shell Programming and Scripting

need inputs on how i can change my script to reduce amount of time the script takes

HI , I have a list1 which consists of data that i have to search and a list2 which has the files that need to be searched .So basically i am using list1 on list2 to see if list1 data is present if found replace it .I have written the code using foreach loop for each list .This is taking the... (1 Reply)
Discussion started by: madhul2002
1 Replies

7. UNIX for Advanced & Expert Users

specifying an execution time

Hi all, do ny o u'll know how to set a particular execution time for a program??? for eg.: --> during the execution of a file, i call a certain other function. --> while calling this function, my comp hangs. now is there ny way in which i can go to the nxt line of code by aborting the call... (7 Replies)
Discussion started by: VGR
7 Replies

8. UNIX for Dummies Questions & Answers

last execution time

is there a command in Solaris 8 that will show a particular scripts last execution time? (1 Reply)
Discussion started by: cubs0729
1 Replies

9. BSD

Reduce boot-time delay on FreeBSD?

Say for instance, I would like to reduce the delay/waiting time for the boot-time menu from 10 seconds to 5 seconds, how would I go about doing it? From what I've been able to find, entering "autoboot 5" into the right file would take care of that for me, but the man pages are unclear as to... (1 Reply)
Discussion started by: DownSouthMoe
1 Replies

10. Programming

execution time

hi , i ve coded a C program in that im using malloc dynamically , it is being called many times in the program The program is to simulate jobs in manufacturing system. the execution time is increasing drastically as the number of jobs are increased. could any body tel what may be the problem... (2 Replies)
Discussion started by: ramki_rk
2 Replies
Login or Register to Ask a Question