shell编程中只需要对变量定义是添加readonly,使变量成为静态变量,例如 readonly A=99 echo "A=$A" unset A echo "A=$A" 将会在第三行报错,不可清空A变量