Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: printing out users without home directories

by huck (Prior)
on May 16, 2018 at 03:30 UTC ( [id://1214605]=note: print w/replies, xml ) Need Help??


in reply to printing out users without home directories

What does "user" mean? do system accounts qualify? The following tests all entries from getent passwd

use strict; use warnings; my @passwd_entries; open (USERS, '-|' , 'getent passwd' ) or die $!; @passwd_entries = <USERS>; close USERS; for my $line (@passwd_entries){ my @parts=split(':',$line); unless ($parts[5]){print $parts[0].' '."No home listed\n";} else { unless (-d $parts[5]) {print $parts[0].' '."dir ".$parts[5]." no +t found\n";} } }
see http://www.linfo.org/etc_passwd.html for the layout of the password file.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1214605]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 14:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found