Hello, Rob.
On Nov 9, 2005, at 10:49 AM, Rob.Savino wrote:
I'm working on a simple script to get a list of users who do not exist
while (<>) {
At this point, $_ ends with "\n".
$user = system("echo $_");
This statement will set $user to the returned value from system(),
which will be a numeric two-byte return code.
$result = system("dsquery user -samID $_");
$result at this point will also be a two-byte return code. It will
likely be non-zero, because you are querying for a value that
has a "\n" at the end of the actual value you really wanted
to query for.
}
if (!$result) {
print "$user\n";
}
Here is my problem,
dsquery user -samID should return nothing if a user does not exist. I
was hoping the script would print $user only if there was no $result
from dsquery user -samID. However, not only does it print every $user
regardless of the was not $result, it also prints every $result.
Can someone tell me why this is?
Thanks,
Rob
--Mariyn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>