LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-22-2009, 08:36 AM   #1
cleve23
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Rep: Reputation: 0
Have some Coding problem!!!!! Please help :D thanks


I want to compare the uid in /etc/passwd. But i have no idea on how to compare with the huge numbers of row and columns? Please help me.
Thanks
 
Old 10-22-2009, 08:40 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Compare the (/etc/passwd) uid to what? and what needs to be done if it is (not) found?
 
Old 10-22-2009, 08:42 AM   #3
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 38
Firstly, you _really_ want to make your title more accurately reflect the content of the post. At best, you're going to attract bored programmers.

Secondly, you need to make your question more specific. What do you want to compare the values with? What's the actual problem you're trying to solve?


The 'standard' manual for how to ask questions that get useful answers quickly is ESR's How To Ask Questions The Smart Way.
I've written a decidedly less thorough but substantially shorter version at http://aviswebsite.co.uk/asking-questions/

I'd rather you read the former, but if you're not going to, at least read the latter, please.
 
Old 10-23-2009, 11:33 PM   #4
cleve23
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Sorry if i make my question not clear. Sorry.
I need to make sure that the uid are unique and has no repeat uid in the /etc/passwd file. I tried using loop but i did not mange to do it.
 
Old 10-24-2009, 02:15 AM   #5
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by cleve23 View Post
Sorry if i make my question not clear. Sorry.
I need to make sure that the uid are unique and has no repeat uid in the /etc/passwd file. I tried using loop but i did not mange to do it.
So show us your code.
 
Old 10-24-2009, 07:13 AM   #6
geek.ksa
Member
 
Registered: Jan 2009
Location: Dhahran, Saudi Arabia
Distribution: RHEL 5
Posts: 42

Rep: Reputation: 17
Quote:
Originally Posted by cleve23 View Post
I need to make sure that the uid are unique and has no repeat uid in the /etc/passwd file. I tried using loop but i did not mange to do it.
To print a list of uids that are duplicate in your passwd file:

cut -d: -f3 /etc/passwd | sort | uniq -d

To print a list of uniq uids:

cut -d: -f3 /etc/passwd | sort | uniq -u


Hope this helps
 
  


Reply

Tags
code


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Some insight on whats going wrong [Not a coding problem, but concept problem] imoracle Linux - Newbie 5 11-13-2008 11:49 PM
Problem with HTML coding bigalexe Programming 1 10-06-2006 01:26 AM
Javascript coding problem Hockeyfan Programming 1 02-01-2006 07:23 AM
problem coding odd loop shams Programming 3 07-17-2004 01:22 PM
problem coding conditional operators shams Programming 1 07-13-2004 07:39 PM


All times are GMT -5. The time now is 02:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration