[Comm] Цикл в командной строке.
Gennadiy Redko
=?iso-8859-1?q?uit1_=CE=C1_zaz=2Ezp=2Eua?=
Ср Май 5 13:50:30 MSD 2004
Dolgov OV пишет:
> Здравствуйте.
>
> Смейтесь, не смейтесь, но я уже голову сломал. Может вопрос и
> примитивный, но для _не программиста_ вроде меня даже русский man bash
> не помогает %-(
>
> Как в командной строке запустить цикл с присвоением переменной i
> числового значения от 1 до 999, или скажем не до 999, а до первой
> ошибки?
>
> надо что-то типа
> for i=1 ; do "чего-то над $i" && i=i+1 ; done
>
> В общем выполнять цикл до тех пор, пока do чего-то (а конкретней wget)
> не вернет ошибку.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Community mailing list
> Community на altlinux.ru
> http://lists.altlinux.ru/mailman/listinfo/community
Я не большой знаток программирования на bash, но почему for а не while ?
$ man bash
.................................................................................................
while list; do list; done
until list; do list; done
The while command continuously executes the do list as
long as
the last command in list returns an exit status of
zero. The
until command is identical to the while command, except
that the
test is negated; the do list is executed as long as
the last
command in list returns a non-zero exit status. The exit
status
of the while and until commands is the exit status of
the last
do list command executed, or zero if none was executed.
..........................................................................................................
Это не то, что Вы хотели?
Подробная информация о списке рассылки community