Re: How to detect user's existence over UNIX
- From: Neo <vikram.sutar@xxxxxxxxx>
- Date: Sun, 21 Oct 2007 22:32:24 -0700
On Oct 19, 7:01 am, Logan Shaw <lshaw-use...@xxxxxxxxxxxxx> wrote:
Rainer Weikusat wrote:
Neo <vikram.su...@xxxxxxxxx> writes:
Is there any generic way to detect user's existence over RHEL and
Solaris? I want to write a shell script to do so. Thanks.
Leaving issue of non-atomicness aside, you could use the id command
for that. 'id <username>' while return a non-zero exit status the user
does not exist.
Alternate method #1:
groups <username>
Alternate method #2:
getent passwd <username>
- Logan
Thanks for all for help !
.
- References:
- How to detect user's existence over UNIX
- From: Neo
- Re: How to detect user's existence over UNIX
- From: Logan Shaw
- How to detect user's existence over UNIX
- Prev by Date: Re: will system() waste memory?
- Next by Date: Re: btree on disk
- Previous by thread: Re: How to detect user's existence over UNIX
- Next by thread: Re: How to detect user's existence over UNIX
- Index(es):
Relevant Pages
|