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 /dev/null In fact, it is a direct replacement for this command line that provides a simpler, more efficient way for both etsh(1) and tsh(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 etsh and tsh. ( : ) >prdots.$$ : Loop echo -n . echo >>prdots.$$ if ! { looptest 80 prdots.$$ } goto Loop echo ; rm -f prdots.$$ Etsh also offers another way to test the looptest exit status with the `$?' special parameter as illustrated below. : Print dots with etsh. ( : ) >prdots.$$ : Loop echo -n . echo >>prdots.$$ looptest 80 prdots.$$ if $? -ne 0 goto Loop echo ; rm -f prdots.$$ SEE ALSO etsh(1), tsh(1) Looptest home page: https://etsh.io/looptest/ AUTHOR This implementation of looptest is written by Jeffrey Allen Neitzel. LICENSE See https://etsh.io/looptest/LICENSE for full details. COPYRIGHT Copyright (c) 2008-2018 Jeffrey Allen Neitzel. All rights reserved. @LT_VERSION@ @LT_DATE@ LOOPTEST(1)