in reply to FInd and permission change
That's just a comment following the print. Is that what you intended? Looks like a formatting error....print <FILE>;#!/usr/bin/perl -w
If you're trying to write the login name of any uid greater than 1000 found in the local /etc/passwd to the file /home/chancock/users, here's what you do:
HTHopen I, '/etc/passwd' or die "Can't open passwd: $!\n"; open F, '>/home/chancock/users' or die "Can't open users: $!\n"; my @passwd; while (<I>) { @passwd = split /:/; print F $passwd[0], "\n" if $passwd[2] > 1000; } close I; close F;
|
|---|