Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: printing out users without home directories

by haukex (Archbishop)
on May 16, 2018 at 06:28 UTC ( [id://1214611]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    ...
        print "$name $uid $home\n"
            if $home !~ m{^/home/} || ! -d $home;
    }
    
  2. or download this
    use warnings;
    use strict;
    ...
        print $pwent->name," ",$pwent->uid," ",$pwent->dir,"\n"
            if $pwent->dir !~ m{^/home/} || ! -d $pwent->dir;
    }
    
  3. or download this
    use warnings;
    use strict;
    ...
        print join(' ', map {$pwent->$_} qw/name uid dir/ ),"\n"
            unless $home->subsumes( dir($pwent->dir) );
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found