Главная страница


ru.linux

 
 - RU.LINUX ---------------------------------------------------------------------
 From : Alexandr Oskolkov                    2:5080/152.10  16 Aug 2001  23:32:31
 To : Serge Matveev
 Subject : bash и циклы
 -------------------------------------------------------------------------------- 
 
 
 
 16 Aug 01 14:31, Serge Matveev wrote to Alexandr Oskolkov:
 
  AO>> for ((i=1;i<=5;i++)); do echo $i; done
  SM> $ for ((i=1;i<=5;i++)); do echo $i; done
  SM> bash: syntax error near unexpected token `(('
  SM> GNU bash, version 2.03.0(1)-release (i386-pc-linux-gnu)
  SM>     Ы?
 
 ao@alexandr[/usr/home/ao]$ for ((i=1;i<=5;i++)); do echo -n "${i} "; done && ec
 ho " вышел зайчик погулять" && bash --version
 1 2 3 4 5  вышел зайчик погулять
 GNU bash, version 2.04.0(1)-release (i386--freebsd4.1)
 Copyright 1999 Free Software Foundation, Inc.
 
 ы ;) меняй башика и будет тебе счастье ;)
 --
        for (( expr1 ; expr2 ; expr3 )) ; do list ; done
               First, the arithmetic expression expr1 is evaluated
               according to the rules described below under ARITH-
               METIC EVALUATION.  The arithmetic expression  expr2
               is  then evaluated repeatedly until it evaluates to
               zero.  Each time  expr2  evaluates  to  a  non-zero
               value,  list is executed and the arithmetic expres-
               sion expr3 is  evaluated.   If  any  expression  is
               omitted,  it  behaves as if it evaluates to 1.  The
               return value is the exit status of the last command
               in  list  that  is executed, or false if any of the
               expressions is invalid.
 --
 With best wishes,
           Alexandr.
 
 --- CB: 1325 || 1339
  * Origin: 2B||!2B=? (2:5080/152.10)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 bash и циклы   Alexandr Oskolkov   02 Aug 2001 20:26:02 
 bash и циклы   Serge Matveev   16 Aug 2001 14:31:46 
 Re: bash и циклы   Dmytro Rud   16 Aug 2001 15:48:13 
 bash и циклы   Alexandr Oskolkov   16 Aug 2001 23:32:31 
 Re: bash и циклы   yx   18 Aug 2001 10:06:37 
Архивное /ru.linux/38463b7c064d.html, оценка 1 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional