bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

for builtin violates Single UNIX Specification


From: Ervin Németh
Subject: for builtin violates Single UNIX Specification
Date: 06 Nov 2001 11:12:21 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

The Single UNIX Specification, Version 2 (available at
http://www.opengroup.org/onlinepubs/007908799/) says:

------------------------------------------------------------------------------
The format for the for loop is as follows: 

     for name [ in word ... ]
     do
         compound-list
     done

First, the list of words following in will be expanded to generate a list of
items. Then, the variable name will be set to each item, in turn, and the
compound-list executed each time. If no items result from the expansion, the
compound-list will not be executed.
------------------------------------------------------------------------------

But

    bash-2.05$ for i in
    bash: syntax error near unexpected token `in'

or

    bash-2.05$ for i in ; do :; done
    bash: syntax error near unexpected token `;'


-Ervin Németh
-- 
Non scholae, sed vitae discimus.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]