Проблемы порождения цикла с условием продолжения KSH

Это делает переменную только для чтения. От help readonly:

readonly: readonly [-aAf] [name[=value] ...] or readonly -p
    Mark shell variables as unchangeable.

    Mark each NAME as read-only; the values of these NAMEs may not be
    changed by subsequent assignment.  If VALUE is supplied, assign VALUE
    before marking as read-only.

    Options:
      -a    refer to indexed array variables
      -A    refer to associative array variables
      -f    refer to shell functions
      -p    display a list of all readonly variables and functions

    An argument of `--' disables further option processing.

    Exit Status:
    Returns success unless an invalid option is given or NAME is invalid.

$b будет всегда возвращаться "1" при создании b с только для чтения. Как пример:

$ a=1
$ a=2
$ readonly b=1
$ b=2
bash: b: readonly variable
$ echo "$a"
2
$ echo "$b"
1
2
29.03.2014, 21:51
2 ответа
[117185] Вы пропустили ключевое слово [117630]do[117631]:[12154]
5
27.01.2020, 21:51
[117187] Вам нужно [117632]do[117633] после [117634]while[117635]: [12155]
3
27.01.2020, 21:51

Теги

Похожие вопросы