Bootstrap FreeKB - Linux Commands - unset (undefine a variable)
Linux Commands - unset (undefine a variable)

Updated:   |  Linux Commands articles

Lets say you've created a variable that contain a value, like this.

foo="bar"

 

When you echo $foo, bar is returned.

echo $foo
bar

 

The unset command will undefine the variable. In this example, the foo variable will no longer be defined.

unset foo

 

Now, when you attempt to echo $foo, nothing is returned, since foo has been unset.

echo $foo

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 0c90e5 in the box below so that we can be sure you are a human.