Skip to main content
2 of 3
added 185 characters in body
HappyFace
  • 1.7k
  • 14
  • 29

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

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
HappyFace
  • 1.7k
  • 14
  • 29