[prog] user bash script

Danijel Tasov mail at vosat.de
Fri Aug 12 19:19:14 EST 2005


Noir wrote:
> I am writing a bash script to adduser which will first
> check if the u_name exist in /etc/passwd file. My
> code:
>
> uname="`echo $uname | tr "[A-Z]" "[a-z]"`"

And then simply do:

if id "$user" ; then
  echo "user already exists" >&2
  exit 1
fi


                                        -DaTa
                                        Danijel Tasov
                                        <dt at vosat.de>
-- 
In any event, the real geeks will probably just have the screen
tattooed on their chest. Or their stomachs. Teletubbies "R" us.
             -- Larry Wall, 8th State of the Onion


More information about the Programming mailing list