Sponsored Content
Top Forums Shell Programming and Scripting Slow Running Script (Reading 8000 lines) Post 302832017 by Yoda on Friday 12th of July 2013 01:06:02 PM
Old 07-12-2013
Try using this awk program instead:
Code:
awk '
        BEGIN {
                F = "file1"
                while (( getline line < F ) > 0 )
                {
                        A1[line]
                }
                close (F)

                F = "file2"
                while (( getline line < F ) > 0 )
                {
                        n = split ( line, V, "=" )
                        if ( V[2] in A1 )
                        {
                                i = V[2]
                                getline line < F
                                n = split ( line, V, "=" )
                                A2[i] = V[2]
                        }
                }
                close (F)

                F = "file3"
                while (( getline line < F ) > 0 )
                {
                        n = split ( line, V, "=" )
                        if ( V[2] in A1 )
                        {
                                i = V[2]
                                getline line < F
                                n = split ( line, V, "=" )
                                A3[i] = V[2]
                        }
                }
                close (F)
        }
        END {
                for ( k in A1 )
                {
                        if ( A2[k] == A3[k] && A2[k] && A3[k] )
                                print k > "matches.out"
                        else
                                print k > "no_matches.out"
                }

        }
' /dev/null

Let me know how long it took to complete execution.
This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

Solaris running very slow!!

Hi all, Solaris is working very slow as login to solaris takes time say after 10 to 15 mins we get the login prompt back after logging in as oracle account/other account. This causes most Batch run delays(DWHouse jobs) scheduled through cronjobs. Where should one look for such issues to... (3 Replies)
Discussion started by: a1_win
3 Replies

2. SCO

Server running slow

Hi, Wonder is someone can help. I've got a server SCO_SV 3.2v5.0.7 PentIII that is located at a different site and is running slow and has been for a week. I've been speaking to a third party who say nothing is wrong with it but its still running slow. The 3rd party advise it could be a... (2 Replies)
Discussion started by: tez
2 Replies

3. HP-UX

SAM running slow

Any ideas on why SAM would take so long to load and initialize? (4 Replies)
Discussion started by: csaunders
4 Replies

4. UNIX for Dummies Questions & Answers

Unix is running slow??

All, This is my interview questions. Let me explain the question. Some one is asking me that, the unix server is running very slow. As a unix unix admin, what are the steps we should follow?? What/which process we should check?? What is the way to find the root cause ? Please let me know.... (8 Replies)
Discussion started by: govindts
8 Replies

5. Shell Programming and Scripting

Reading multi lines variable using shell script

Hi, I am using #!/bin/sh shell. I have a variable which contains multi line data. I want to read that variable line by line. Can someone post the code to read the multi line variable line by line? Any help is much appreciated. (2 Replies)
Discussion started by: gupt_ash
2 Replies

6. Shell Programming and Scripting

script for reading logs of a script running on other UNIX server

Hi, I have a script, running on some outside firwall server and it's log of success or failure is maintained in a file. I want to write a script which ftp that server and reads that file and checks the logs and if failure , I will send mail notification. Please let meknow if I am not... (1 Reply)
Discussion started by: vandana.parwani
1 Replies

7. Shell Programming and Scripting

awk script - reading input lines

Can I do something like, if($0==/^int.*$/) { print "Declaration" } for an input like: int a=5; If the syntax is right, it is not working for me, but I am not sure about the syntax. Please help. Thanks, Prasanna (1 Reply)
Discussion started by: prasanna1157
1 Replies

8. UNIX for Dummies Questions & Answers

Ubuntu seems running slow!

Hello, My PC seems running slow: OS32 system, Pentium(R)4---2.40Ghz, 1GB RAM, 80GB HDI am running Ubuntu 11.10 (Oneiric Ocelot) alone in this box, which seems very slow to me. Is this normal? Compared with my other PC (Running XP) with 1.99GHz AMD Athlon 3200+, 2GB RAM,500GB HD, XP and Mint... (11 Replies)
Discussion started by: yifangt
11 Replies

9. AIX

AIX server running very slow

Hello, All the commands on AIX are running very slow. Below is few stats but I didn't find any issue in cpu or memory reosurces vmstat System configuration: lcpu=4 mem=6144MB ent=1.00 kthr memory page faults cpu ----- -----------... (2 Replies)
Discussion started by: Vishal_dba
2 Replies

10. Shell Programming and Scripting

Shell script reading file slow

I have shell program as below #!/bin/sh echo ======= LogManageri start ========== #This directory is getting the raw data from remote server Raw_data=/opt/ftplogs # This directory is ready for process the data Processing_dir=/opt/processing_dir # This directory is prcoessed files and... (4 Replies)
Discussion started by: Chenchireddy
4 Replies
GROUP.CONF(5)							 Linux-PAM Manual						     GROUP.CONF(5)

NAME
group.conf - configuration file for the pam_group module DESCRIPTION
The pam_group PAM module does not authenticate the user, but instead it grants group memberships (in the credential setting phase of the authentication module) to the user. Such memberships are based on the service they are applying for. For this module to function correctly there must be a correctly formatted /etc/security/group.conf file present. White spaces are ignored and lines maybe extended with '' (escaped newlines). Text following a '#' is ignored to the end of the line. The syntax of the lines is as follows: services;ttys;users;times;groups The first field, the services field, is a logic list of PAM service names that the rule applies to. The second field, the tty field, is a logic list of terminal names that this rule applies to. The third field, the users field, is a logic list of users, or a UNIX group, or a netgroup of users to whom this rule applies. Group names are preceded by a '%' symbol, while netgroup names are preceded by a '@' symbol. For these items the simple wildcard '*' may be used only once. With UNIX groups or netgroups no wildcards or logic operators are allowed. The times field is used to indicate "when" these groups are to be given to the user. The format here is a logic list of day/time-range entries. The days are specified by a sequence of two character entries, MoTuSa for example is Monday Tuesday and Saturday. Note that repeated days are unset MoMo = no day, and MoWk = all weekdays bar Monday. The two character combinations accepted are Mo Tu We Th Fr Sa Su Wk Wd Al, the last two being week-end days and all 7 days of the week respectively. As a final example, AlFr means all days except Friday. Each day/time-range can be prefixed with a '!' to indicate "anything but". The time-range part is two 24-hour times HHMM, separated by a hyphen, indicating the start and finish time (if the finish time is smaller than the start time it is deemed to apply on the following day). The groups field is a comma or space separated list of groups that the user inherits membership of. These groups are added if the previous fields are satisfied by the user's request. For a rule to be active, ALL of service+ttys+users must be satisfied by the applying process. EXAMPLES
These are some example lines which might be specified in /etc/security/group.conf. Running 'xsh' on tty* (any ttyXXX device), the user 'us' is given access to the floppy (through membership of the floppy group) xsh;tty*&!ttyp*;us;Al0000-2400;floppy Running 'xsh' on tty* (any ttyXXX device), the user 'sword' is given access to games (through membership of the floppy group) after work hours. xsh; tty* ;sword;!Wk0900-1800;games, sound xsh; tty* ;*;Al0900-1800;floppy Any member of the group 'admin' running 'xsh' on tty*, is granted access (at any time) to the group 'plugdev' xsh; tty* ;%admin;Al0000-2400;plugdev SEE ALSO
pam_group(8), pam.d(5), pam(8) AUTHOR
pam_group was written by Andrew G. Morgan <morgan@kernel.org>. Linux-PAM Manual 09/19/2013 GROUP.CONF(5)
All times are GMT -4. The time now is 02:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy