penguinfuz has asked for the wisdom of the Perl Monks concerning the following question:
The users with "false" and "" shells are excluded, but "null" shells still get printed; However, the exclusion works if I populate the variables by using split...while(($name,$pass,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getp +went()) { if(!($shell =~ m/false/ || m/null/ || m//)) { print blah... } }
Can anyone offer me a bit of insight as to what's happening here?... while(<PW>) { ($name,$pass,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = split(/: +/); print blah... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex and getpwent()...
by japhy (Canon) on May 28, 2001 at 05:01 UTC | |
|
Re: regex and getpwent()...
by bobione (Pilgrim) on May 28, 2001 at 05:10 UTC | |
by japhy (Canon) on May 28, 2001 at 05:25 UTC | |
by penguinfuz (Pilgrim) on May 28, 2001 at 05:41 UTC |