• Caveman@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    10 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.

    • Laser@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      6 hours ago

      That doesn’t help you if you want to get the result of something that happened in the function without capturing stdout, does it?