Linux常用命令-unset

命令

unset

描述

Unset values and attributes of shell variables and functions
取消变量

用法

1
unset [name ...]

选项

注意

readonly只读变量无法取消

示例

1
2
3
4
5
6
7
$ a=3
$ echo $a
3
$ unset a
$ echo $a