[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feature todo .. be able to unset vars at assignment stage , without
From: |
Zachary Santer |
Subject: |
Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment |
Date: |
Thu, 22 Feb 2024 10:40:12 -0500 |
On Wed, Feb 21, 2024 at 4:38 PM Chet Ramey <chet.ramey@case.edu> wrote:
>
> OK. What's the use case for this?
>
If you want to set environment variables in a given command's environment,
you can just place those assignments in front of the command you want to
run. If there's an exported variable present in the script, or in the
interactive shell, that you don't want present in the command's
environment, your options are:
a) call the command using the env command with the --unset flag, or
b) turn off the variable's export attribute before calling the command and
then turn it back on afterwards.
Having a way for bash itself to unset a variable only within the
environment of a given command, within the call to that command, might be
useful. How often will the behavior of any given utility differ between
having an environment variable set to the empty string versus having it
unset? Of course, env isn't able to run a builtin.
I don't know what kind of syntax you could use for this, and my use case
here might actually conflict with what Alex is suggesting.
- feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, alex xmb sw ratchev, 2024/02/21
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, alex xmb sw ratchev, 2024/02/21
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Andreas Kähäri, 2024/02/21
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Lawrence Velázquez, 2024/02/21
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, alex xmb sw ratchev, 2024/02/21
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Greg Wooledge, 2024/02/21
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Chet Ramey, 2024/02/21
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, alex xmb sw ratchev, 2024/02/22
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, alex xmb sw ratchev, 2024/02/22
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment,
Zachary Santer <=
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Zachary Santer, 2024/02/22
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Greg Wooledge, 2024/02/22
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Zachary Santer, 2024/02/23
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Greg Wooledge, 2024/02/23
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Zachary Santer, 2024/02/23
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, alex xmb sw ratchev, 2024/02/23
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Zachary Santer, 2024/02/23
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Greg Wooledge, 2024/02/23
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, Zachary Santer, 2024/02/23
- Re: feature todo .. be able to unset vars at assignment stage , without unset util , for coding language fair extendment, alex xmb sw ratchev, 2024/02/23