Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

How to unset an environment variable in bash

Answer:

To unset an environment variable in bash, you can use the unset command.

Example:

# export foo=bar
# echo $foo
bar
# unset foo
# echo $foo

  1. How to add a directory into the PATH environment variable?
  2. Simple environment variable usage in Linux
  3. How to set a shell variable
  4. How to get the PID in current bash shell script
  5. How to echo a tab in bash?

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>