The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ssh Long time to return prompt. cesmk SUN Solaris 8 06-29-2009 02:19 PM
How long does AIX resync the time with another server victorcheung AIX 0 07-21-2008 07:54 AM
Debug env for long time use nephilimbe High Level Programming 2 02-12-2008 07:04 AM
rcp gets hung for long time panchpan AIX 0 01-09-2008 10:02 PM
fwrite takes extremely long time inna High Level Programming 5 07-06-2005 07:19 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-28-2009
abdulaziz abdulaziz is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 15
help - exec time too long

Dear everyone...

thanks to this forum I am able to do everyday more and more complex scripts...but now I come up with problem with optimisation..


problem 1 - optimise:
here is my code:


Code:
        while read number
                        do
                             nawk -F "|" -v ms="$number" ' {  if ($2==ms) { print $0 ; } } ' AllnumbersFile | nawk -F "|" '{print $2"|"$14 }'  | nawk -F"|" '{print $1"|"substr($0,13,4)""substr($0,18,2)""substr($0,21,2)}' >> MergedOutput
        done < $dir/1000NumbersFile

and files:

head 1000NumbersFile :

32762879208
48762880032
48762880052
48763881141
48762882490
32761884631
42761884632


head MergedOutput :

38762879208|20090928
32762879208|20090928
48762880032|20090928
48762880052|20090928
48763881141|20090928
48762882490|20090928
32761884631|20090928
42761884632|20090928




AllnumbersFile :

1|38762879208|0|1000|2000-01-01 00:00:00.0|90|1|0|false|0|0|0|0|1070-00-01 01:00:00.0|0|0|1900-01-01 01:00:00.0|1
1|48762880052|0|1000|2000-01-01 00:00:00.0|90|1|0|false|0|0|0|0|1070-00-01 01:00:00.0|0|0|1900-01-01 01:00:00.0|1
1|42761884632|0|1000|2000-01-01 00:00:00.0|90|1|0|false|0|0|0|0|1070-00-01 01:00:00.0|0|0|1900-01-01 01:00:00.0|1
1|48763881141|0|1000|2000-01-01 00:00:00.0|90|1|0|false|0|0|0|0|1070-00-01 01:00:00.0|0|0|1900-01-01 01:00:00.0|1


time is tooo long..


problem 2:
also is it possible taht when system is too busy my script from cron is being stopped. (I notices it becouse it executes everyday from cron and one day additional files is being erased - as script say and the other those files stay - like the end of script is not executed ?!?!?)

---------- Post updated at 01:55 PM ---------- Previous update was at 11:48 AM ----------

anyone??
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0