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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.