• Caveman@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    3 hours ago

    Turns out you can, by using () instead of {} in the function declaration you can run the function in a subshell where changes to variables are scoped to the subshell and functions are local.