0
点赞
收藏
分享

微信扫一扫

CentOS 7 - 环境变量

岛上码农 2022-06-14 阅读 74

系统层面

/etc/profile

/etc/bashrc


用户层面

用户目录下

.bash_profile

.bashrc

.cshrc (csh)

即刻生效

source .bashrc


当前会话

bash

export h=Hello
export h="$h World"
export h="$h@2019"
export h="${h}August"
echo $h

csh

setenv h Hello
setenv h "$h World"
setenv h "$h@2019"
setenv h "${h}August"
echo $h

建议.bash_profile

if [ -f <sub>/.bashrc ]; then
source </sub>/.bashrc
fi


-bash-4.2$

cd /etc/skel
cp .bash_logout .bash_profile .bashrc ~/


举报

相关推荐

0 条评论