[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: home directories...



On Fri, Aug 27, 1999 at 09:25:33PM -0700, Bradley Bell wrote:
> I need to write a script which will run once a night, and check each
> user's home directory for a certain file.  Does anybody know the best way
> to do this?  The only thing I can think of is to parse /etc/passwd to get
> the home dir of each user of UID > 999. Is this the correct way to do it?
> What routines should one use when parsing /etc/passwd?
> 
> -Brad

Here is a snippet I used once. (It's perl)

while (@list = getpwent()) {
    ($login, $grp, $name, $home) = @list[0, 3, 5, 7];
    # ... Do Something
}


-- 
   Jim Foltz <aa204@acorn.net> <jfoltz@raex.com>
ACORN techie <http://www.acorn.net>
      AOL/IM Jim Foltz


Reply to: