我想使用环境变量来保存值,重新启动系统后,这个变量必须包含最后保存的值
我试试这个
root@OpenWrt:~# BOOTT=1
root@OpenWrt:~# export
export HOME='/root'
export LOGNAME='root'
export PATH='/bin:/sbin:/usr/bin:/usr/sbin'
export PS1='\u@\h:\w\$ '
export PWD='/root'
export SHELL='/bin/ash'
export SSH_CONNECTION='192.168.1.110 2961 192.168.1.122 22'
export SSH_TTY='/dev/pts/0'
export TERM='xterm'
export USER='root'
root@OpenWrt:~# export BOOTT
root@OpenWrt:~# export
export BOOTT='1'
export HOME='/root'
export LOGNAME='root'
export PATH='/bin:/sbin:/usr/bin:/usr/sbin'
export PS1='\u@\h:\w\$ '
export PWD='/root'
export SHELL='/bin/ash'
export SSH_CONNECTION='192.168.1.110 2961 192.168.1.122 22'
export SSH_TTY='/dev/pts/0'
export TERM='xterm'
export USER='root'
root@OpenWrt:~#
root@OpenWrt:~# reboot
root@OpenWrt:~#
==> 重启后
root@OpenWrt:~# export
export HOME='/root'
export LOGNAME='root'
export PATH='/bin:/sbin:/usr/bin:/usr/sbin'
export PS1='\u@\h:\w\$ '
export PWD='/root'
export SHELL='/bin/ash'
export SSH_CONNECTION='192.168.1.110 3217 192.168.1.122 22'
export SSH_TTY='/dev/pts/0'
export TERM='xterm'
export USER='root'
root@OpenWrt:~# echo $BOOTT
root@OpenWrt:~#
所以我可以获得可以在重启后保存值的环境变量!