[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.5.4.7 for-each: perform function on each operand

This produces a main procedure that invokes a procedure once for each operand on the command line (non-option arguments), OR once for each non-blank, non-comment stdin input line. Leading and trailing white space is trimmed from the input line and comment lines are lines that are empty or begin with a comment character, defaulting to a hash (’#’) character.

NB: The argument program attribute (see section Program Description Attributes) must begin with the [ character, to indicate that there are command operands, but that they are optional.

For an example of the produced main procedure, in the ‘autoopts/test’ build directory, type the following command and look at ‘main.c’:

 
make verbose TESTS=main.test

This document was generated by Bruce Korb on August 21, 2015 using texi2html 1.82.