Unsetting an exported environment variable

konmi

I am using export to set an environment variable.

export OPCON_VERBOS=${vb}

How can I then unset it later so that it stops being define anymore?

Sotto Voce
unset OPCON_VERBOS

or

OPCON_VERBOS=

or

OPCON_VERBOS=""

The unset removes the environment variable (and its value). The others keep the environment variable, but remove its value.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Unsetting environment variable with an empty name

Unsetting an environment variable vs. setting it to zero

Environment variable not exported

Most defensive/robust way of unsetting an environment variable inside a shell script

Unsetting a variable in Velocity

Unsetting Superglobal Variable Properly

How do I delete an exported environment variable?

Triggering an error on unsetting a traced variable

whether the environment variable exported in c function will be available in parent shell?

Set exported environment variable in Bash to default value if unset, mention it once

Environment variable exported using bash script not accessible in python

How to fix session not starting after unsetting a variable

Is unsetting environment variables always cause some fallback behavior?

I exported the environment variable from entrypoint, but why can't I see it when I printed it in the docker container?

How to use a value stored in an environment variable that is formed during run time? (env var is exported beforehand)

Does bash have a way to un-export a variable without unsetting it?

Is unsetting a single bit in flags safe with Python variable-length integers?

Fill variable in exported file

Exported Environment Variables vs Environment Variables

Is an exported variable in Javascript considered global?

How to use an exported variable in a makefile?

shell variable not exported from subshell?

Webpack exported variable is not visible by browser

exported const variable is undefined in vue

Typescript + Vue reactive exported variable

accessing changed value of exported variable

why can't `_` be exported to the environment of bash?

List all environment variables, and show if they are exported or not

Unable to fetch the environment variables exported through subprocess