...
Code Block | ||||
---|---|---|---|---|
| ||||
open( PASSWD, "<", "/etc/passwd"); my @users = <PASSWD>; my @shell_users = grep +(s|/bin/sh||), @users; foreach my $user (@shell_users) { print "Shell User: $user"; } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
open( PASSWD, "<", "/etc/passwd"); my @users = <PASSWD>; my @shell_users = grep +(m|/bin/sh|), @users; foreach my $user (@shell_users) { $user =~= s|/bin/sh||; print "Shell User: $user"; } |
...