Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: code tweaks to eliminiate warnings

...

Code Block
bgColor#ffcccc
langperl
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
bgColor#ccccff
langperl
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";
}

...