Unix Shell - newbie help !

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > January 2007 > newbie help !





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author newbie help !
Faouzi Gassemi

2007-01-23, 1:23 pm

hji how could i remove a user from the /etc/passwd file in a bash script ?


user1:/home/user1:/bin/bash
user2:/home/user2:/bin/bash
user3:/home/user3:/bin/bash

i would like to have a assurance that it is user1 like (y/n)
and remove him from the file.

Thanks
Conrad J. Sabatier

2007-01-24, 1:47 am

In article SrOdnZD-2Pf7tivYnZ2dnUVZ_r3inZ2d@umontreal.ca, dated Tue, 23
Jan 2007 10:36:06 -0500, Faouzi Gassemi <faouzi@DMS.UMontreal.CA> wrote:

> hji how could i remove a user from the /etc/passwd file in a bash script ?
>
>
> user1:/home/user1:/bin/bash
> user2:/home/user2:/bin/bash
> user3:/home/user3:/bin/bash
>
> i would like to have a assurance that it is user1 like (y/n)
> and remove him from the file.
>
> Thanks


Simply removing the user's entry from /etc/passwd alone is not a good
idea. Most systems provide tools for managing the user/password database,
and if you circumvent these by trying a shortcut method, you're asking for
trouble, i.e., you'll wind up with corruption in the database.

It's impossible to advise you any further without knowing the specific OS
you're running, as the tools vary from system to system.

--
Conrad J. Sabatier <conrads@cox.net>
"In Unix veritas"
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com