Mudanças entre as edições de "Bash"
De WikiLICC
m (→Links) |
m (→Links) |
||
Linha 39: | Linha 39: | ||
* http://www.linuxfromscratch.org/blfs/view/6.3/postlfs/profile.html | * http://www.linuxfromscratch.org/blfs/view/6.3/postlfs/profile.html | ||
* http://humanreadable.nfshost.com/sdeg/bash_startup.htm | * http://humanreadable.nfshost.com/sdeg/bash_startup.htm | ||
+ | |||
+ | * http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files |
Edição das 19h34min de 2 de julho de 2010
Verificar quais shell são disponíveis no sistema
[user]$ more /etc/shells /bin/sh /bin/bash /sbin/nologin /bin/zsh
/bin/bash
The program /bin/bash uses a set of startup files in /etc or an equivalent file in your home directory.
- Interactive login shell: /bin/login
- after reading /etc/passwd file
- reads /etc/profile
- reads ~/.bash_profile
- Interactive non-login shell: at the command-line using a shell program (e.g., [prompt]$/bin/bash) or by the /bin/su command. An interactive non-login shell is also started with a terminal program such as xterm or konsole from within a graphical environment.
- Normally copies the parent environment
- reads ~/.bashrc
- Non-interactive shell: usually present when a shell script is running. Only the environment inherited from the parent shell is used.
- ~/.bash_logout: read and executed when a user exits from an interactive login shell.
- /etc/bashrc : for system wide initialization of non-login shells. This file is usually called from the user's ~/.bashrc file and is not built directly into bash itself. This convention is followed in this section.
/etc/profile
Alguns arquivos importantes:
colorls.sh % ls colorido lang.sh % definicoes do charset usado, LANG, LC_CTYPE mpich2.sh % module load mpich2-x86_64 vim.sh % para o vi shell-colors.sh % ADICIONADO. Contém atalhos para cores e o comando para mudar a cor do prompt % PS1="${BOLDYELLOW}\u${BOLDWHITE}@${BOLDGREEN}\h ${BOLDBLUE}\W \$ ${COLOR_RESET}"