I'm new from UNIX scripting. Please help.
I have about 10,000 files from the $ROOTDIR/scp/inbox/string1 directory to compare with the 50 files from /$ROOTDIR/output/tma/pnt/bad/string1/ directory and it takes about 2 hours plus to complete the for loop. Is there a better way to re-write the script below so it can process faster.
Thank you in advance.
Use builtin commands (no need to use ls, sed and awk in this case).
Lines:
pntcnt1=$( ls -l /$ROOTDIR/scp/inbox/string1 | grep 'PNT.*' | awk '/^-/ {print $9}' | wc -l )
[ $pntcnt1 -lt 1 ] && exit 0
kshji:
you mean
instead of
right?
and gline & bline should start at position 38 instead of 37, am I correct?
Thanks
---------- Post updated at 04:05 PM ---------- Previous update was at 01:27 PM ----------
I got and error when execute the script below x=${gline:38:9}: 0403-011 The specified substitution is not valid for this command.
I want to compare file's value from $ROOTDIR/scp/inbox/string1 directory at the position 38 with 9 charaters long to the file in /$ROOTDIR/output/tma/pnt/bad/string1/ directory with the same position and length. It looks like the code below is written to compare just for the file name.
I wish I can do that myself, my UNIX admin won't allow me to do that. Anyway, I'd like to
1. Check and compare the 10,000 pnt files contains single record from the /$ROOTDIR/scp/inbox/string1 directory against 39 bad pnt files from the /$ROOTDIR/output/tma/pnt/bad/string1 directory based on the fam_id column value start at position 38 to 47 from the record below. Here is an example of the record from the file in both directories:
PNT0220060503081122003700100000091049000005629001005146417001407712SFirstname Lastname
2. If fam_id is matched then move current file from the /$ROOTDIR/scp/inbox/string1 directory into the /$ROOTDIR/output/tma/pnt/bad/string1 directory.
If not then continue the normal process
The below code is worked but it took 2 plus hours to complete the comparison process. Please advice if there is a better way to re-write or improve the comparison process to make it run faster and better. Thanks
I have so many (hundreds of thousands) files and directories within this one specific directory that my "rm -rf" command to delete them has been taking forever.
I did this via the SSH, my question is: if my SSH connection times out before rm -rf finishes, will it continue to delete all of those... (5 Replies)
Hi,
All the data are kept on Netapp using NFS. some directories are so fast when doing ls but few of them are slow. After doing few times, it becomes fast. Then again after few minutes, it becomes slow again. Can you advise what's going on?
This one directory I am very interested is giving... (3 Replies)
Dear All,
OS = Solaris 5.10
Hardware Sun Fire T2000 with 1 Ghz quode core
We have oracle application 11i with 10g database. When ever i am trying to take cold backup of database with 55GB size its taking long time to finish. As the application is down nobody is using the server at all... (8 Replies)
It's almost 3 days now and my resync/re-attach is only at 80%. Is there something I can check in Solaris 10 that would be causing the degradation. It's only a standby machine.
My live system completed in 6hrs. (9 Replies)
Hi ,
We have 20 jobs are scheduled.
In that one of our job is taking long time ,it's not completing.
If we are not terminating it's running infinity time actually the job completion time is 5 minutes.
The job is deleting some records from the table and two insert statements and one select... (7 Replies)
grep -f taking long time to compare for big files, any alternate for fast check
I am using grep -f file1 file2 to check - to ckeck dups/common rows prsents. But my files contains file1 contains 5gb and file 2 contains 50 mb and its taking such a long time to compare the files.
Do we have any... (10 Replies)
Hi,
I have here a script which is used to purge older files/directories based on defined purge period. The script consists of 45 find commands, where each command will need to traverse through more than a million directories. Therefore a single find command executes around 22-25 mins... (7 Replies)
I'd like to
1. Check and compare the 10,000 pnt files contains single record from the /$ROOTDIR/scp/inbox/string1 directory against 39 bad pnt files from the /$ROOTDIR/output/tma/pnt/bad/string1 directory based on the fam_id column value start at position 38 to 47 from the record below. Here is... (1 Reply)
I'm having a bit of a login performance issue.. wondering if anyone has any ideas where I might look.
Here's the scenario...
Linux Red Hat ES 4 update 5
regardless of where I login from (ssh or on the text console) after providing the password the system seems to pause for between 30... (4 Replies)