I have tried the following command to set Proxy on
The question is how to unset the proxy on
In general, how can I unset the value of a variable in the current shell?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
To remove an environment variable, run
Note that an environment variable only takes effect in a program and the program it launches. If you set an environment variable in one shell window, it doesn't affect other shell windows.
If you've added
export ALL_PROXY=… to an initialization file, remove it from there.
You can run
export with no arguments to see what environment variables are set in the current shell.
Remember that to make a shell variable available to the programs started by that shell, you need to export it, either by running
export VAR after the assignment
VAR=VALUE or by combining the two (
To unset a bound variable in bash use
unset VARIABLE (
unset ALL_PROXY in your case).
This command actually deletes the variable. You can also set the value of a variable to empty by
The difference is that the two latter commands don't delete the variable.
You can see the difference by using the
-u flag with
set to force it to treat the unset variables as an error while substituting:
/home/user1> var="" /home/user1> echo $var /home/user1> set -u /home/user1> echo $var /home/user1> unset var /home/user1> echo $var -bash: var: unbound variable
In the above example, bash complains about
var is unbound (after unsetting its value) which is the expected error (note that this does not happen in second echo command, meaning that
var has a value which is