Link to home
Start Free TrialLog in
Avatar of allenm040397
allenm040397

asked on

Help with Perl and removing info from a ypcat

I want to find where each users home account is.. I am doing
a:

      #!/serve/bin/perl -w
        open(USERS, "user_list") || die "could not open file ($!)";
        while(<USERS>) {
            $person="$_";      
            $local = `ypcat passwd | grep $person`;
            print $local;
        }    

I want to remove the exta info that the ypcat gives me.  I tried doing
a $local =~ s/^$person//g; to start widdling away at the output of $person
but it doesn't work.

Any suggestions?

-Allen
ASKER CERTIFIED SOLUTION
Avatar of trip040397
trip040397

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial