...
Code Block | ||||
---|---|---|---|---|
| ||||
open( PASSWD, "<", "/etc/passwd");
@users = <PASSWD>;
@shell_users = grep +(s|/bin/sh||), @users;
foreach $user (@shell_users) {
print "Shell User: $user";
}
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
open( PASSWD, "<", "/etc/passwd");
@users = <PASSWD>;
@shell_users = grep +(m|/bin/sh|), @users;
foreach $user (@shell_users) {
$user ~= s|/bin/sh||;
print "Shell User: $user";
}
|
...
[Conway 05] pg. 114, "List Processing Side Effects"
[Wall 2011] perlfunc
[CPAN] Bar, Graham. List::Utils
[CPAN] Kennedy, Adam. List::MoreUtils
...