[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Q
Erez Doron <erez@savan.com> writes:
>
> Hi
>
> does anybody knows of a unix command that
> checks if a there is such a user on the system ?
>
> i meen that I'll ask if there is a username 'yossi' or 'moshe'
> on this host, and I'll get an answer
>
Yes Virginia, there is one:
awk -F: '{print $1}' /etc/passwd | grep USER_NAME_YOU_SEARCH
ie (for b*sh/ksh):
userp () { awk -F: '{print $1}' /etc/passwd | grep "^$1$";}
--
Alexander L. Belikoff
Berger Financial Research Ltd.
abel@bfr.co.il
- Follow-Ups:
- Re: Q
- From: Erez Doron <erez@savan.com>
- References:
- Q
- From: Erez Doron <erez@savan.com>