Is there a way to set a var above it's current scope?
X-seq: zsh-workers 51457
From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
To: Zsh hackers list <zsh-workers@xxxxxxx>
Subject: Is there a way to set a var above it's current scope?
Date: Sat, 18 Feb 2023 15:55:31 +0100
Archived-at: <https://zsh.org/workers/51457>
List-id: <zsh-workers.zsh.org>
Hi,
Somewhere in the man I saw something like: if you use export you'll always set in global scope, regardless of any local variable collision. However, (){local q; export q=1;};print $q doesn't print 1. Is there any way of achieving this?