0

I came upon this code:

map () {
    eval "$initDocs"
    usage "<lambda-function> [<item>...]"
    example "'<--- \$1 --->'" a b c d
    eval "$doneDocs"
    typeset f="$1"
    shift
    map_ () {
        echo ${(e)==f}
    }
    eval "$loopNow" map_
}

I do not understand what is the difference between ${(e)f} and ${(e)==f}.

1

From zshexpn(1):

${=spec}

    Perform word splitting using the rules for SH_WORD_SPLIT during the
    evaluation of spec, but regardless of whether the parameter appears
    in double quotes; if the `=' is doubled, turn it off.

In other words, specifying ${==f} explicitly turns off SH_WORD_SPLIT for this single expansion, regardless of whether it is active globally.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.