zsh: Is it possible to implement a `local export`?Is there something like closures for zsh?Tab autocompletion...

Can a Hogwarts student refuse the Sorting Hat's decision?

Based on what criteria do you add/not add icons to labels within a toolbar?

Did Apollo leave poop on the moon?

Why do cheap flights with a layover get more expensive when you split them up into separate flights?

Repeated! Factorials!

Is an "are" omitted in this sentence

Can attackers change the public key of certificate during the SSL handshake

Why private jets such as GulfStream ones fly higher than other civil jets?

Purchased new computer from DELL with pre-installed Ubuntu. Won't boot. Should assume its an error from DELL?

What could prevent players from leaving an island?

What is the probability of a biased coin coming up heads given that a liar is claiming that the coin came up heads?

Changing Row Keys into Normal Rows

Will a research paper be retracted if the code (which was made publicly available) is shown to have a flaw in the logic?

split large formula in align

Did WWII Japanese soldiers engage in cannibalism of their enemies?

Is DC heating faster than AC heating?

Why should I "believe in" weak solutions to PDEs?

How do I get the =LEFT function in excel, to also take the number zero as the first number?

Can I enter a rental property without giving notice if I'm afraid a tenant may be hurt?

Where to pee in London?

Getting matrices labels

Can chords be inferred from melody alone?

Do you like Music? This word is Historic

Best way to explain to my boss that I cannot attend a team summit because it is on Rosh Hashana or any other Jewish Holiday



zsh: Is it possible to implement a `local export`?


Is there something like closures for zsh?Tab autocompletion of accented characters with oh-my-zsh doesn't workSetting environment variables with .bash_profile: only last export works properlyCalling zsh completion function and obtaining its resultsImplement a key-value deserialization or something similarbash vs zsh: scoping and `typeset -g`Why can't I define a readonly variable named path in zsh?How can I define zstyle completion preference for a zsh alias?Zsh: Put all non-global parameters to anonymous/local inner functionzsh tab complete . to ./






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Is it possible to implement a local export in zsh? Possibly using try and always?



Does this create race-conditions?



By local export, I mean sth exactly like a local variable, that is accessible to the subprocesses (in scope).



Example:



function a() {
local export YACY_TIMEOUT=60
yacy -r -d sth
}
export YACY_TIMEOUT=4
echo "$YACY_TIMEOUT" # 4
a
echo "$YACY_TIMEOUT" # 4









share|improve this question



























  • What would it be local to? Please show an example use case.

    – muru
    1 hour ago











  • @muru done .............

    – HappyFace
    1 hour ago


















0















Is it possible to implement a local export in zsh? Possibly using try and always?



Does this create race-conditions?



By local export, I mean sth exactly like a local variable, that is accessible to the subprocesses (in scope).



Example:



function a() {
local export YACY_TIMEOUT=60
yacy -r -d sth
}
export YACY_TIMEOUT=4
echo "$YACY_TIMEOUT" # 4
a
echo "$YACY_TIMEOUT" # 4









share|improve this question



























  • What would it be local to? Please show an example use case.

    – muru
    1 hour ago











  • @muru done .............

    – HappyFace
    1 hour ago














0












0








0








Is it possible to implement a local export in zsh? Possibly using try and always?



Does this create race-conditions?



By local export, I mean sth exactly like a local variable, that is accessible to the subprocesses (in scope).



Example:



function a() {
local export YACY_TIMEOUT=60
yacy -r -d sth
}
export YACY_TIMEOUT=4
echo "$YACY_TIMEOUT" # 4
a
echo "$YACY_TIMEOUT" # 4









share|improve this question
















Is it possible to implement a local export in zsh? Possibly using try and always?



Does this create race-conditions?



By local export, I mean sth exactly like a local variable, that is accessible to the subprocesses (in scope).



Example:



function a() {
local export YACY_TIMEOUT=60
yacy -r -d sth
}
export YACY_TIMEOUT=4
echo "$YACY_TIMEOUT" # 4
a
echo "$YACY_TIMEOUT" # 4






zsh environment-variables






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago







HappyFace

















asked 1 hour ago









HappyFaceHappyFace

3731 silver badge11 bronze badges




3731 silver badge11 bronze badges
















  • What would it be local to? Please show an example use case.

    – muru
    1 hour ago











  • @muru done .............

    – HappyFace
    1 hour ago



















  • What would it be local to? Please show an example use case.

    – muru
    1 hour ago











  • @muru done .............

    – HappyFace
    1 hour ago

















What would it be local to? Please show an example use case.

– muru
1 hour ago





What would it be local to? Please show an example use case.

– muru
1 hour ago













@muru done .............

– HappyFace
1 hour ago





@muru done .............

– HappyFace
1 hour ago










3 Answers
3






active

oldest

votes


















1














Use a subshell:



function a() (
YACY_TIMEOUT=60
yacy -r -d sth
)


Example:



% a () ( TIMEOUT=60; env | grep TIMEOUT )
% export TIMEOUT=4
% echo $TIMEOUT
4
% a
TIMEOUT=60
% echo $TIMEOUT
4





share|improve this answer


























  • But there, the YACY_TIMEOUT is only exported in the function it was already exported in the caller.

    – Stéphane Chazelas
    1 min ago



















0














This doesn't do exactly what you want, as it doesn't actually create a new variable in the current shell:



a () {
YACY_TIMEOUT=60 yacy -r -d std
}


This is the standard syntax for running a command and giving it a particular value of an environment variable. The variable YACY_TIMEOUT, if it exists in the same scope as the body of the a function, would not be modified.



This would work in any POSIX shell.



What this does not do is to allow you to use YACY_TIMEOUT with the "local" value inside the function before calling yacy.



In zsh or any other shell that supports local variables declared with local, you could do



a () {
local YACY_TIMEOUT=60

YACY_TIMEOUT=$YACY_TIMEOUT yacy -r -d sth
}


Here, YACY_TIMEOUT would be local to the a function. The injection of the variable as an environment variable in the yacy process happens as in the first example I gave, by preceding the invocation by an assignment.



Now YACY_TIMEOUT is both local and is also available in the yacy process' environment. This would work in any shell that supports using local to declare local variables.






share|improve this answer


























  • This necessates having code written in a specialized manner. The subshell solution works with any code, including code that we can not modify.

    – HappyFace
    23 mins ago











  • @HappyFace What part of the code are you not able to modify? Also note that I'm not doing anything "special" here, and that the second piece of code is not very different from your own proposal.

    – Kusalananda
    22 mins ago





















0














Variables are always available to sub-processes. In:



a=1
(echo "$a")


you see 1.



I think what you meant is that you want the variable to have a local scope and be exported to the environment so that they are passed as environment variables to commands that are executed. The execution of a command is the thing that wipes the memory a process (and the environment is a way to preserve some data across it), forking a child copies the entire memory so everything is preserved.



For that, you can use local -x:



a=(1 2)
f() {
local -x a=3
typeset -p a
printenv a # printenv being *executed*
}
f
typeset -p a


gives:



typeset -x a=3
3
typeset -a a=( 1 2 )


Or you can export it after having been declared local:



a=(1 2)
f() {
local a=3
export a
typeset -p a
printenv a # printenv being *executed*
}
f
typeset -p a


Note that you can pass a variable in the environment of a single command without defining it otherwise as a shell variable with:



a=(1 2)
f() {
a=3 printenv a # printenv being *executed*
}
f
typeset -p a


Note that local originated in the Almquist shell in the late 80s, but works differently from zsh's. In the Almquist shell (and its descendants like dash and the sh of NetBSD/FreeBSD), local only affects the scope of a variable and doesn't change the value or attributes of a variable.



zsh's local works more like ksh93's typeset in that it declares a brand new variable that is independent from the one in the outer scope.



ksh88, bash and pdksh's local/typeset try to do that as well but still inherit some attributes from the variable of the outer scope including the export attribute. That changed in ksh93 though note that ksh93 also switched to static scoping and only implements local scope in functions declared with the function f { ...; } syntax.






share|improve this answer






























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f534271%2fzsh-is-it-possible-to-implement-a-local-export%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Use a subshell:



    function a() (
    YACY_TIMEOUT=60
    yacy -r -d sth
    )


    Example:



    % a () ( TIMEOUT=60; env | grep TIMEOUT )
    % export TIMEOUT=4
    % echo $TIMEOUT
    4
    % a
    TIMEOUT=60
    % echo $TIMEOUT
    4





    share|improve this answer


























    • But there, the YACY_TIMEOUT is only exported in the function it was already exported in the caller.

      – Stéphane Chazelas
      1 min ago
















    1














    Use a subshell:



    function a() (
    YACY_TIMEOUT=60
    yacy -r -d sth
    )


    Example:



    % a () ( TIMEOUT=60; env | grep TIMEOUT )
    % export TIMEOUT=4
    % echo $TIMEOUT
    4
    % a
    TIMEOUT=60
    % echo $TIMEOUT
    4





    share|improve this answer


























    • But there, the YACY_TIMEOUT is only exported in the function it was already exported in the caller.

      – Stéphane Chazelas
      1 min ago














    1












    1








    1







    Use a subshell:



    function a() (
    YACY_TIMEOUT=60
    yacy -r -d sth
    )


    Example:



    % a () ( TIMEOUT=60; env | grep TIMEOUT )
    % export TIMEOUT=4
    % echo $TIMEOUT
    4
    % a
    TIMEOUT=60
    % echo $TIMEOUT
    4





    share|improve this answer













    Use a subshell:



    function a() (
    YACY_TIMEOUT=60
    yacy -r -d sth
    )


    Example:



    % a () ( TIMEOUT=60; env | grep TIMEOUT )
    % export TIMEOUT=4
    % echo $TIMEOUT
    4
    % a
    TIMEOUT=60
    % echo $TIMEOUT
    4






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 1 hour ago









    murumuru

    43.5k5 gold badges108 silver badges181 bronze badges




    43.5k5 gold badges108 silver badges181 bronze badges
















    • But there, the YACY_TIMEOUT is only exported in the function it was already exported in the caller.

      – Stéphane Chazelas
      1 min ago



















    • But there, the YACY_TIMEOUT is only exported in the function it was already exported in the caller.

      – Stéphane Chazelas
      1 min ago

















    But there, the YACY_TIMEOUT is only exported in the function it was already exported in the caller.

    – Stéphane Chazelas
    1 min ago





    But there, the YACY_TIMEOUT is only exported in the function it was already exported in the caller.

    – Stéphane Chazelas
    1 min ago













    0














    This doesn't do exactly what you want, as it doesn't actually create a new variable in the current shell:



    a () {
    YACY_TIMEOUT=60 yacy -r -d std
    }


    This is the standard syntax for running a command and giving it a particular value of an environment variable. The variable YACY_TIMEOUT, if it exists in the same scope as the body of the a function, would not be modified.



    This would work in any POSIX shell.



    What this does not do is to allow you to use YACY_TIMEOUT with the "local" value inside the function before calling yacy.



    In zsh or any other shell that supports local variables declared with local, you could do



    a () {
    local YACY_TIMEOUT=60

    YACY_TIMEOUT=$YACY_TIMEOUT yacy -r -d sth
    }


    Here, YACY_TIMEOUT would be local to the a function. The injection of the variable as an environment variable in the yacy process happens as in the first example I gave, by preceding the invocation by an assignment.



    Now YACY_TIMEOUT is both local and is also available in the yacy process' environment. This would work in any shell that supports using local to declare local variables.






    share|improve this answer


























    • This necessates having code written in a specialized manner. The subshell solution works with any code, including code that we can not modify.

      – HappyFace
      23 mins ago











    • @HappyFace What part of the code are you not able to modify? Also note that I'm not doing anything "special" here, and that the second piece of code is not very different from your own proposal.

      – Kusalananda
      22 mins ago


















    0














    This doesn't do exactly what you want, as it doesn't actually create a new variable in the current shell:



    a () {
    YACY_TIMEOUT=60 yacy -r -d std
    }


    This is the standard syntax for running a command and giving it a particular value of an environment variable. The variable YACY_TIMEOUT, if it exists in the same scope as the body of the a function, would not be modified.



    This would work in any POSIX shell.



    What this does not do is to allow you to use YACY_TIMEOUT with the "local" value inside the function before calling yacy.



    In zsh or any other shell that supports local variables declared with local, you could do



    a () {
    local YACY_TIMEOUT=60

    YACY_TIMEOUT=$YACY_TIMEOUT yacy -r -d sth
    }


    Here, YACY_TIMEOUT would be local to the a function. The injection of the variable as an environment variable in the yacy process happens as in the first example I gave, by preceding the invocation by an assignment.



    Now YACY_TIMEOUT is both local and is also available in the yacy process' environment. This would work in any shell that supports using local to declare local variables.






    share|improve this answer


























    • This necessates having code written in a specialized manner. The subshell solution works with any code, including code that we can not modify.

      – HappyFace
      23 mins ago











    • @HappyFace What part of the code are you not able to modify? Also note that I'm not doing anything "special" here, and that the second piece of code is not very different from your own proposal.

      – Kusalananda
      22 mins ago
















    0












    0








    0







    This doesn't do exactly what you want, as it doesn't actually create a new variable in the current shell:



    a () {
    YACY_TIMEOUT=60 yacy -r -d std
    }


    This is the standard syntax for running a command and giving it a particular value of an environment variable. The variable YACY_TIMEOUT, if it exists in the same scope as the body of the a function, would not be modified.



    This would work in any POSIX shell.



    What this does not do is to allow you to use YACY_TIMEOUT with the "local" value inside the function before calling yacy.



    In zsh or any other shell that supports local variables declared with local, you could do



    a () {
    local YACY_TIMEOUT=60

    YACY_TIMEOUT=$YACY_TIMEOUT yacy -r -d sth
    }


    Here, YACY_TIMEOUT would be local to the a function. The injection of the variable as an environment variable in the yacy process happens as in the first example I gave, by preceding the invocation by an assignment.



    Now YACY_TIMEOUT is both local and is also available in the yacy process' environment. This would work in any shell that supports using local to declare local variables.






    share|improve this answer













    This doesn't do exactly what you want, as it doesn't actually create a new variable in the current shell:



    a () {
    YACY_TIMEOUT=60 yacy -r -d std
    }


    This is the standard syntax for running a command and giving it a particular value of an environment variable. The variable YACY_TIMEOUT, if it exists in the same scope as the body of the a function, would not be modified.



    This would work in any POSIX shell.



    What this does not do is to allow you to use YACY_TIMEOUT with the "local" value inside the function before calling yacy.



    In zsh or any other shell that supports local variables declared with local, you could do



    a () {
    local YACY_TIMEOUT=60

    YACY_TIMEOUT=$YACY_TIMEOUT yacy -r -d sth
    }


    Here, YACY_TIMEOUT would be local to the a function. The injection of the variable as an environment variable in the yacy process happens as in the first example I gave, by preceding the invocation by an assignment.



    Now YACY_TIMEOUT is both local and is also available in the yacy process' environment. This would work in any shell that supports using local to declare local variables.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 26 mins ago









    KusalanandaKusalananda

    158k18 gold badges313 silver badges498 bronze badges




    158k18 gold badges313 silver badges498 bronze badges
















    • This necessates having code written in a specialized manner. The subshell solution works with any code, including code that we can not modify.

      – HappyFace
      23 mins ago











    • @HappyFace What part of the code are you not able to modify? Also note that I'm not doing anything "special" here, and that the second piece of code is not very different from your own proposal.

      – Kusalananda
      22 mins ago





















    • This necessates having code written in a specialized manner. The subshell solution works with any code, including code that we can not modify.

      – HappyFace
      23 mins ago











    • @HappyFace What part of the code are you not able to modify? Also note that I'm not doing anything "special" here, and that the second piece of code is not very different from your own proposal.

      – Kusalananda
      22 mins ago



















    This necessates having code written in a specialized manner. The subshell solution works with any code, including code that we can not modify.

    – HappyFace
    23 mins ago





    This necessates having code written in a specialized manner. The subshell solution works with any code, including code that we can not modify.

    – HappyFace
    23 mins ago













    @HappyFace What part of the code are you not able to modify? Also note that I'm not doing anything "special" here, and that the second piece of code is not very different from your own proposal.

    – Kusalananda
    22 mins ago







    @HappyFace What part of the code are you not able to modify? Also note that I'm not doing anything "special" here, and that the second piece of code is not very different from your own proposal.

    – Kusalananda
    22 mins ago













    0














    Variables are always available to sub-processes. In:



    a=1
    (echo "$a")


    you see 1.



    I think what you meant is that you want the variable to have a local scope and be exported to the environment so that they are passed as environment variables to commands that are executed. The execution of a command is the thing that wipes the memory a process (and the environment is a way to preserve some data across it), forking a child copies the entire memory so everything is preserved.



    For that, you can use local -x:



    a=(1 2)
    f() {
    local -x a=3
    typeset -p a
    printenv a # printenv being *executed*
    }
    f
    typeset -p a


    gives:



    typeset -x a=3
    3
    typeset -a a=( 1 2 )


    Or you can export it after having been declared local:



    a=(1 2)
    f() {
    local a=3
    export a
    typeset -p a
    printenv a # printenv being *executed*
    }
    f
    typeset -p a


    Note that you can pass a variable in the environment of a single command without defining it otherwise as a shell variable with:



    a=(1 2)
    f() {
    a=3 printenv a # printenv being *executed*
    }
    f
    typeset -p a


    Note that local originated in the Almquist shell in the late 80s, but works differently from zsh's. In the Almquist shell (and its descendants like dash and the sh of NetBSD/FreeBSD), local only affects the scope of a variable and doesn't change the value or attributes of a variable.



    zsh's local works more like ksh93's typeset in that it declares a brand new variable that is independent from the one in the outer scope.



    ksh88, bash and pdksh's local/typeset try to do that as well but still inherit some attributes from the variable of the outer scope including the export attribute. That changed in ksh93 though note that ksh93 also switched to static scoping and only implements local scope in functions declared with the function f { ...; } syntax.






    share|improve this answer
































      0














      Variables are always available to sub-processes. In:



      a=1
      (echo "$a")


      you see 1.



      I think what you meant is that you want the variable to have a local scope and be exported to the environment so that they are passed as environment variables to commands that are executed. The execution of a command is the thing that wipes the memory a process (and the environment is a way to preserve some data across it), forking a child copies the entire memory so everything is preserved.



      For that, you can use local -x:



      a=(1 2)
      f() {
      local -x a=3
      typeset -p a
      printenv a # printenv being *executed*
      }
      f
      typeset -p a


      gives:



      typeset -x a=3
      3
      typeset -a a=( 1 2 )


      Or you can export it after having been declared local:



      a=(1 2)
      f() {
      local a=3
      export a
      typeset -p a
      printenv a # printenv being *executed*
      }
      f
      typeset -p a


      Note that you can pass a variable in the environment of a single command without defining it otherwise as a shell variable with:



      a=(1 2)
      f() {
      a=3 printenv a # printenv being *executed*
      }
      f
      typeset -p a


      Note that local originated in the Almquist shell in the late 80s, but works differently from zsh's. In the Almquist shell (and its descendants like dash and the sh of NetBSD/FreeBSD), local only affects the scope of a variable and doesn't change the value or attributes of a variable.



      zsh's local works more like ksh93's typeset in that it declares a brand new variable that is independent from the one in the outer scope.



      ksh88, bash and pdksh's local/typeset try to do that as well but still inherit some attributes from the variable of the outer scope including the export attribute. That changed in ksh93 though note that ksh93 also switched to static scoping and only implements local scope in functions declared with the function f { ...; } syntax.






      share|improve this answer






























        0












        0








        0







        Variables are always available to sub-processes. In:



        a=1
        (echo "$a")


        you see 1.



        I think what you meant is that you want the variable to have a local scope and be exported to the environment so that they are passed as environment variables to commands that are executed. The execution of a command is the thing that wipes the memory a process (and the environment is a way to preserve some data across it), forking a child copies the entire memory so everything is preserved.



        For that, you can use local -x:



        a=(1 2)
        f() {
        local -x a=3
        typeset -p a
        printenv a # printenv being *executed*
        }
        f
        typeset -p a


        gives:



        typeset -x a=3
        3
        typeset -a a=( 1 2 )


        Or you can export it after having been declared local:



        a=(1 2)
        f() {
        local a=3
        export a
        typeset -p a
        printenv a # printenv being *executed*
        }
        f
        typeset -p a


        Note that you can pass a variable in the environment of a single command without defining it otherwise as a shell variable with:



        a=(1 2)
        f() {
        a=3 printenv a # printenv being *executed*
        }
        f
        typeset -p a


        Note that local originated in the Almquist shell in the late 80s, but works differently from zsh's. In the Almquist shell (and its descendants like dash and the sh of NetBSD/FreeBSD), local only affects the scope of a variable and doesn't change the value or attributes of a variable.



        zsh's local works more like ksh93's typeset in that it declares a brand new variable that is independent from the one in the outer scope.



        ksh88, bash and pdksh's local/typeset try to do that as well but still inherit some attributes from the variable of the outer scope including the export attribute. That changed in ksh93 though note that ksh93 also switched to static scoping and only implements local scope in functions declared with the function f { ...; } syntax.






        share|improve this answer















        Variables are always available to sub-processes. In:



        a=1
        (echo "$a")


        you see 1.



        I think what you meant is that you want the variable to have a local scope and be exported to the environment so that they are passed as environment variables to commands that are executed. The execution of a command is the thing that wipes the memory a process (and the environment is a way to preserve some data across it), forking a child copies the entire memory so everything is preserved.



        For that, you can use local -x:



        a=(1 2)
        f() {
        local -x a=3
        typeset -p a
        printenv a # printenv being *executed*
        }
        f
        typeset -p a


        gives:



        typeset -x a=3
        3
        typeset -a a=( 1 2 )


        Or you can export it after having been declared local:



        a=(1 2)
        f() {
        local a=3
        export a
        typeset -p a
        printenv a # printenv being *executed*
        }
        f
        typeset -p a


        Note that you can pass a variable in the environment of a single command without defining it otherwise as a shell variable with:



        a=(1 2)
        f() {
        a=3 printenv a # printenv being *executed*
        }
        f
        typeset -p a


        Note that local originated in the Almquist shell in the late 80s, but works differently from zsh's. In the Almquist shell (and its descendants like dash and the sh of NetBSD/FreeBSD), local only affects the scope of a variable and doesn't change the value or attributes of a variable.



        zsh's local works more like ksh93's typeset in that it declares a brand new variable that is independent from the one in the outer scope.



        ksh88, bash and pdksh's local/typeset try to do that as well but still inherit some attributes from the variable of the outer scope including the export attribute. That changed in ksh93 though note that ksh93 also switched to static scoping and only implements local scope in functions declared with the function f { ...; } syntax.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 4 mins ago

























        answered 21 mins ago









        Stéphane ChazelasStéphane Chazelas

        328k57 gold badges638 silver badges1006 bronze badges




        328k57 gold badges638 silver badges1006 bronze badges

































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f534271%2fzsh-is-it-possible-to-implement-a-local-export%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...