From: "Lawrence Velázquez" <vq@larryv.me>
To: "Christoph Anton Mitterer" <calestyo@scientia.org>
Cc: dash@vger.kernel.org
Subject: Re: wrong behaviour when unsetting/setting some variables
Date: Mon, 26 Feb 2024 23:23:16 -0500 [thread overview]
Message-ID: <e1f38631-18fa-4962-89ee-d9bddd83eb58@app.fastmail.com> (raw)
In-Reply-To: <43f0631aea36f6b49e5c3dfdfe481a5a2b1fec6c.camel@scientia.org>
On Mon, Feb 26, 2024, at 9:07 PM, Christoph Anton Mitterer wrote:
> The consequence of that is at least, that one has no chance to fully
> unset these variables and even if they loose their value, they’ll be
> exported to executed commands, possibly altering their behaviour.
They are not exported.
% env -i /opt/local/bin/dash
$ export MAIL=v
$ unset -v MAIL
$ export
export MAIL
export PWD='/private/tmp'
$ env
PWD=/private/tmp
Their local counterparts are not exported, either.
% env -i /opt/local/bin/dash
$ f() { local FOO=v; export FOO; unset -v FOO; export; env; }
$ f
export FOO
export PWD='/private/tmp'
PWD=/private/tmp
--
vq
next prev parent reply other threads:[~2024-02-27 4:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 2:07 wrong behaviour when unsetting/setting some variables Christoph Anton Mitterer
2024-02-27 3:07 ` Harald van Dijk
2024-02-27 3:28 ` Christoph Anton Mitterer
2024-02-27 10:24 ` Harald van Dijk
2024-02-27 4:23 ` Lawrence Velázquez [this message]
2024-02-27 5:11 ` Christoph Anton Mitterer
2024-02-27 7:53 ` Lawrence Velázquez
2024-02-29 12:29 ` Christoph Anton Mitterer
2024-02-29 17:58 ` Martijn Dekker
2024-02-29 19:03 ` Christoph Anton Mitterer
2024-02-28 0:56 ` Harald van Dijk
2024-02-29 12:24 ` Christoph Anton Mitterer
2024-02-29 18:03 ` Martijn Dekker
2024-02-29 17:41 ` Martijn Dekker
2024-02-29 18:07 ` Harald van Dijk
2024-02-29 18:45 ` Martijn Dekker
2024-02-29 18:56 ` Harald van Dijk
2024-03-10 21:33 ` Martijn Dekker
2024-04-11 1:26 ` Christoph Anton Mitterer
2024-04-11 7:43 ` [PATCH] var: Fix unexporting of local variables using unset Herbert Xu
2024-04-11 13:27 ` Christoph Anton Mitterer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1f38631-18fa-4962-89ee-d9bddd83eb58@app.fastmail.com \
--to=vq@larryv.me \
--cc=calestyo@scientia.org \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox