首页 > 代码库 > 【学习笔记】bash shell 登录,注销,执行等

【学习笔记】bash shell 登录,注销,执行等

  • 登录:

bash先执行/etc/profile,再调用~/.bash_profile.

  • 注销:

bash调用~/.bash_logout.

  • 执行新shell:

在kde,gnone,icewm等桌面管理程序中,执行终端程序或手动执行

/bin/bash,或在编辑程序中调用shell,会先调用/etc/bash.bashrc,

再调用~/.bashrc

  • 执行script(使用#!/bin/bash):

不调用.bash_profile,.bashrc,但会检查BASH_ENV的内容,如果为非空

则执行它指定的启动文件。

  • 执行script(使用#!/bin/sh):

不调用任何启动文件,没有其他检查环境变量的操作。

【学习笔记】bash shell 登录,注销,执行等