[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Localised variables become exposed to environment when FUNCNEST reached
From: |
felix |
Subject: |
Localised variables become exposed to environment when FUNCNEST reached |
Date: |
Sun, 27 Nov 2022 16:55:25 +0100 |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2
uname output: Linux medium 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2
(2022-10-21) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.2
Patch Level: 12
Release Status: release
Description:
Localised variable in a function could alter environ when FUNCNEST is
reached
Repeat-By:
$ funcTest() { local FUNCNEST=1 LocalVar=Not\ Global;$FUNCNAME;}
$ echo $LocalVar
$ funcTest
bash: funcTest: maximum function nesting level exceeded (1)
$ echo $LocalVar
Not Global
( Once playing with this, don't miss to `unset FUNCNEST`! ;-)
- Localised variables become exposed to environment when FUNCNEST reached,
felix <=