[HPADM] RE: SUMMARY: Matching File Records



Oops, small typo there on the redirect.
The actual command I used was:
grep -f <username list> <passwd file list> | uniq > <matched records file>




-----Original Message-----
From: hpux-admin-owner@xxxxxxxxxxxxx [mailto:hpux-admin-owner@xxxxxxxxxxxxx]
On Behalf Of Whittemore, Dale
Sent: Wednesday, June 13, 2007 10:54 AM
To: hpux-admin@xxxxxxxxxxxxx
Subject: [HPADM] SUMMARY: Matching File Records

Thanks for all the quick responses.

Steve Sandau suggested "grep -f file1 file2 > outputfile and Jeff Lightner
suggested the join command which when used with the -j option produces the
same output as the one Steve Sandau suggested. Both produce two lines of
the same thing but I can overcome by piping the 'uniq' command before
redirecting to the output file.
The command I used to get what I wanted was:
grep -f <username list> <passwd file list> | uniq | <matched records file>

Thanks again.

Dale Whittemore
Unix System Administrator, Sr.
Lockheed Martin EIS


-----Original Message-----
From: hpux-admin-owner@xxxxxxxxxxxxx [mailto:hpux-admin-owner@xxxxxxxxxxxxx]
On Behalf Of Whittemore, Dale
Sent: Wednesday, June 13, 2007 10:23 AM
To: hpux-admin@xxxxxxxxxxxxx
Subject: [HPADM] Matching File Records

I have two different files, one containing just a user login names and
another containing fields 1 and 5 of the passwd file.
I want to create a file that has only those records in the second file that
match the user names in the first file. Is there any quick way to do this
using the diff command or should I do a Perl script. I know nothing of AWK
and VERY little about SED.


Thanks

Dale Whittemore
Unix System Administrator, Sr.
Lockheed Martin EIS

Attachment: smime.p7s
Description: S/MIME cryptographic signature



Relevant Pages

  • Re: Selecting First Row of List Box
    ... "Dale Fye" wrote in message ... I added a command button to my form and used the latest code I provided to ... Have you checked to make sure that the list has the Multiselect property set ... >>>> After making a selection in the combo box and the records get ...
    (microsoft.public.access.forms)
  • RE: Deploying Office 2000 with SMS 2003
    ... A transfor can be used in the command like see sxample: ... Dale ...
    (microsoft.public.sms.admin)
  • Re: Case statement
    ... "Dale Hagglund" wrote: ... > W> this string to see if it is either within a certain numeric ... The patterns in a case statement are ... > at the command prompt. ...
    (comp.unix.shell)
  • [HPADM] [SUMMARY]Help with character replacement
    ... Dale A. Whittemore ... Unix System Admin Senior ... I want to put a space between the first comma and the Firstname and change the second comma to a space. ...
    (HP-UX-Admin)
  • Re: DDE or command line arguments/parameters
    ... "Dale" wrote in message ... > have it automatically download an archive from a vendors web site. ... That's what the Synchronize command is for. ... the following command line automatically open Inet and has it> open the specified web page: ...
    (microsoft.public.windows.inetexplorer.ie6.browser)