квазивложенные условия в bash не работают из-за синтаксической ошибки elif

Как узнать.

# type.
. is a shell builtin

# help.
.:. filename [arguments]
    Execute commands from a file in the current shell.

    Read and execute commands from FILENAME in the current shell.  The
    entries in $PATH are used to find the directory containing FILENAME.
    If any ARGUMENTS are supplied, they become the positional parameters
    when FILENAME is executed.

    Exit Status:
    Returns the status of the last command executed in FILENAME; fails if
    FILENAME cannot be read.
0
06.12.2020, 01:12
1 ответ

Проблема вif [ $? -eq 0 ] then;

Это должно бытьif [ $? -eq 0 ] ; then

Кое-что из этого вы написали правильно, но число неверно.

Причина, по которой ему не нравился elif, заключается в том, что он был частью тестов на if, так как не было оператора, начинающегося с then.

2
18.03.2021, 22:45

Теги

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