Connecting Tech Pros Worldwide Forums | Help | Site Map

compare columns

Member
 
Join Date: Mar 2008
Posts: 114
#1: Aug 6 '09
I have 1 file that I need to compare two columns and count how many account names (column1 ie jollywg) do not have a /home directory with that name (column 6 ie /home/jollywg). The file name is /etc/passwd...how can I do this!!...i've been scouring the internet for hours and have come up with nothing.

Thanks in advance!
Jollywg

numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,571
#2: Aug 21 '09

re: compare columns


Quote:

Originally Posted by Jollywg View Post

I have 1 file that I need to compare two columns and count how many account names (column1 ie jollywg) do not have a /home directory with that name (column 6 ie /home/jollywg). The file name is /etc/passwd...how can I do this!!...i've been scouring the internet for hours and have come up with nothing.

Thanks in advance!
Jollywg

This should be easy enough in shell or another language, what have you tried? I ask this because this sounds like a question asked for homework.

Regards,

Jeff
Reply

Tags
column, compare, file, linux, unix