linux shell 环境,Linux shell 环境

当用户登录时,环境变量会从多个位置设置,包括/etc/profile(针对所有用户)、/etc/profile.d/目录下的所有文件、~/.bash_profile(登录shell)和~/.bashrc(交互式非登录shell)。/etc/profile.d/是存放应用程序特定设置的好地方,例如,用于设置SSH为CVS默认的RSH。通过在该目录下创建并执行脚本,可以实现这些设置。
摘要由CSDN通过智能技术生成

Linux Shell Environment Setup Using /etc/profile.d/*

When a user logs in, environment variables are set from various places.  That includes:

/etc/profile (for all users).

Then all the files in the /etc/profile.d directory.

Then ~/.bash_profile.

Then ~/.bashrc.

/etc/profile.d/ is a good place to put your application specific setups.  For example, I always use SSH for CVS (cf. RSH).  So I use:

echo "export CVS_RSH=ssh" >> /etc/profile.d/cvs.sh

chmod +x /etc/profile.d/cvs.sh

# From: Unix - Frequently Asked Questions (5/7) [Frequent posting]

#

# bash

#     Start-up (in this order):

#         /etc/profile  - login shells.

#         .bash_profile - login shells.

#         .profile      - login if no .bash_profile is present.

#         .bashrc       - interactive non-login shells.

#         $ENV          - always, if it is set.

#

#     Upon termination:

#         .bash_logout  - login shells.

#

#     Others:

#         .inputrc      - Readline initialization.

if [ -f $HOME/.bashrc ]

then

. $HOME/.bashrc

fi

完!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值