I use "print count-only where" in scripts quite a bit (example below) as its cleaner than using :len. The down side is I get unwanted integers printed to the console which are the counts.
Is there a way that I can use a count only without printing the result to console? The only way I can think of is to capture the output of the print count only in a variable first, before runnign the if statement.
Example
Code: Select all
:if ([ /user print count-only where name=$usercn; ] = 0) do={
:put ("Creating the user " . $usercn);
/user add name=$usercn group=$group address=$address password=$password comment=$comment;
};
MC