help with matching




I'm working on a simple script to get a list of users who do not exist

while (<>) {
$user = system("echo $_");
$result = system("dsquery user -samID $_");
}
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
.



Relevant Pages

  • Re: help with matching
    ... > I'm working on a simple script to get a list of users who do not exist ... > dsquery user -samID should return nothing if a user does not exist. ... Prev by Date: ...
    (perl.beginners)
  • RE: help with matching
    ... > Subject: help with matching ... if it fails or succeeds your script will output the user ... queries instead of performing system calls. ... > dsquery user -samID should return nothing if a user does not exist. ...
    (perl.beginners)
  • Re: Fokker-Republic D-24 Alliance Cut-Away
    ... only one movie project has brought me on board as a tech ... Not everyone can read a script and make it sound professional, ... Arndt ya, Xenia... ... If Xenia is Rob in drag... ...
    (rec.aviation.military)
  • Re: The Active Directory property cannot be found in the cache
    ... Rob wrote: ... > spreadsheet which works ok using the script below I am also trying to create ...
    (microsoft.public.windows.server.scripting)
  • Re: AWK problem need help
    ... The script is as follows: ... printf ("PAT:%s\n", $prev) ... The latter would print the field at whatever position "var" contains, and the whole record if var is zero or unset. ... Also, you don't need the " " as the final argument to splitas that's the default, and awk arrays start at 1, not 0 so "lastline" will always be empty. ...
    (comp.unix.shell)