Chinaunix首页 | 论坛 | 博客
  • 博客访问: 135254
  • 博文数量: 42
  • 博客积分: 2521
  • 博客等级: 少校
  • 技术积分: 440
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-31 21:29
文章分类

全部博文(42)

文章存档

2011年(1)

2010年(33)

2009年(8)

我的朋友

分类: LINUX

2010-08-30 16:44:37

1.2.2.2. Bash startup files

Startup files are scripts that are read and executed by Bash when it starts. The following subsections describe different ways to start the shell, and the startup files that are read consequently.

1.2.2.2.1. Invoked as an interactive login shell, or with `--login'

Interactive means you can enter commands. The shell is not running because a script has been activated. A login shell means that you got the shell after authenticating to the system, usually by giving your user name and password.

Files read:

  • /etc/profile

  • ~/.bash_profile, ~/.bash_login or ~/.profile: first existing readable file is read

  • ~/.bash_logout upon logout.

Error messages are printed if configuration files exist but are not readable. If a file does not exist, bash searches for the next.

1.2.2.2.2. Invoked as an interactive non-login shell

A non-login shell means that you did not have to authenticate to the system. For instance, when you open a terminal using an icon, or a menu item, that is a non-login shell.

Files read:

  • ~/.bashrc

This file is usually referred to in ~/.bash_profile:

if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

阅读(728) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~