RE: [Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
Comm command is ideal; it was built for this type of text processing problem. It requires sorted (collated) input lists. cut -d: -f1 /etc/passwd | sort pass_f1 # provide sorted list of the first field in the passwd file cut -d: -f1 /etc/samba/smbpasswd | sort smbpass_f1 # provide sorted list of the first field in the smbpasswd file then run comm. -3 pass_f1 smbpass_f1 |more this will show two columns: first is entries unique to passwd, the second column are entries unique to smbpasswd comm command has several forms based on its output in three columns: lines unique to file1, lines unique to file2 and lines found in both files. comm -1 file1 file2 displays the items that are unique to file2 [-1 says omit results unique to file1 ] comm -2 file1 file2 displays the items that are unique to file1 [-2 says omit results unique to file2] comm -3 file1 file2 displays the items that are not common to file1 and file2 comm -12 file1 file2 displays the items that are found in both file1 and file2 Andy Colb Investment Company Institute -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan Novosielski Sent: Thursday, January 24, 2008 2:25 PM To: John Drescher Cc: Samba Subject: Re: [Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Drescher wrote: On Jan 24, 2008 1:15 PM, Kristoffer Knigga [EMAIL PROTECTED] wrote: diff probably sort as well and maybe awk cut -f1 -d: to get the first field. Then sort, then diff, or a new favorite: comm . =R - -- _ _ _ _ ___ _ _ _ |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer II |$| |__| | | |__/ | \| _| |[EMAIL PROTECTED] - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/AST - NJMS Medical Science Bldg - C630 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHmOYcmb+gadEcsb4RAlwxAKDZMjjuURRaHss5hM4QraGP52g7fQCgg3vX Iaqio+2+Xb7afWRGSUGoe2M= =I0yg -END PGP SIGNATURE- -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
RE: [Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
diff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adam Williams Sent: Thursday, January 24, 2008 12:04 PM To: Samba Subject: [Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd Is there a command I can run that will compare the users in /etc/samba/smbpasswd against the users in /etc/passwd and print the ones that exist in smbpasswd but not passwd? -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
On Jan 24, 2008 1:15 PM, Kristoffer Knigga [EMAIL PROTECTED] wrote: diff probably sort as well and maybe awk -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] compare users in /etc/passwd versus /etc/samba/smbpasswd
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Drescher wrote: On Jan 24, 2008 1:15 PM, Kristoffer Knigga [EMAIL PROTECTED] wrote: diff probably sort as well and maybe awk cut -f1 -d: to get the first field. Then sort, then diff, or a new favorite: comm . =R - -- _ _ _ _ ___ _ _ _ |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer II |$| |__| | | |__/ | \| _| |[EMAIL PROTECTED] - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/AST - NJMS Medical Science Bldg - C630 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHmOYcmb+gadEcsb4RAlwxAKDZMjjuURRaHss5hM4QraGP52g7fQCgg3vX Iaqio+2+Xb7afWRGSUGoe2M= =I0yg -END PGP SIGNATURE- -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba