help-bash
[Top][All Lists]
Advanced

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

declare -f changes 'elif' to 'else if'


From: sukolyn
Subject: declare -f changes 'elif' to 'else if'
Date: Mon, 21 Feb 2022 15:27:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

hi,

here's the picture :

$ myFunc() { if test foo; then : ; elif test bar; then : ; else : ; fi;}

$ declare -f myFunc

myFunc ()
{
    if test foo; then
        :;
    else
        if test bar; then
            :;
        else
            :;
        fi;
    fi
}

`else' should be subordonate(?) to main `if' (i.e. `foo' command), not to inner if (`bar' command)


NB : I might have missed previous messages about this mileading interpretation.


reply via email to

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