looptest.1 - nroff source : Read looptest(1) in pdf, ps, or txt form.

LOOPTEST(1)                    General Commands                    LOOPTEST(1)

NAME
       looptest - loop iteration tester

SYNOPSIS
       looptest count file

DESCRIPTION
       The looptest utility counts the number  of lines in the specified file
       and compares it with the specified count.  It exits with an appropriate
       status according to whether this comparison is equal or not equal.

       Notice that this utility has the same effect as doing a:

              wc -l <file | tr -d ' \t' | grep '^count$' >/dev/null

       In fact, it is a direct replacement for this command line that provides
       a simpler, more efficient way for both osh(1)  and  sh6(1)  to  perform
       count-controlled loops.

EXIT STATUS
       The looptest utility exits with one of the following values:

       0      The file line count is equal to count.

       1      The file line count is not equal to count.

       2      An error was detected.

EXAMPLES
       Each  of the following command files causes the shell to perform a loop
       that prints 80 dots to the standard output.

            : Print dots with osh and sh6.

            ( : ) >prdots.$$

            : Loop
                 echo -n .
                 echo >>prdots.$$
                 if ! { looptest 80 prdots.$$ } goto Loop

            echo ; rm -f prdots.$$

       Osh also offers another way  to test the looptest exit status with the
       `$s' special parameter as illustrated below.

            : Print dots with osh.

            ( : ) >prdots.$$

            : Loop
                 echo -n .
                 echo >>prdots.$$
                 looptest 80 prdots.$$
                 if $s != 0 goto Loop

            echo ; rm -f prdots.$$

SEE ALSO
       osh(1), sh6(1)

       Looptest home page: http://v6shell.org/looptest/

AUTHOR
       This implementation of looptest is written by Jeffrey Allen Neitzel.

LICENSE
       See http://v6shell.org/looptest/LICENSE for full details.

looptest-20081030              October 30, 2008                    LOOPTEST(1)