Comparison with the Bourne shell and csh startup sequences Bash (Unix shell)




1 comparison bourne shell , csh startup sequences

1.1 setting inheritable environment variables
1.2 aliases , functions
1.3 commands performed @ login , logout
1.4 legacy-compatible bash startup example





comparison bourne shell , csh startup sequences

elements of bash derive bourne shell , csh. these allow limited startup file sharing bourne shell , provide startup features familiar csh users.



aliases , functions

these 2 facilities, aliases csh , more general functions largely supersede them bourne shell, not typically inheritable login shell, , had redefined in each subshell spawned login shell. although there env environment variable applied problem, both csh , bash support per-subshell startup files address directly. in bash, ~/.bashrc called interactive subshells. if user-defined functions ~/.bashrc desired in login shell well, ~/.bash_login can include line below after setting of environment variables:



commands performed @ login , logout

the csh supports ~/.login file purposes of tasks performed during initial login, such displaying system load, disk status, whether email has come in, logging login time, etc. bourne shell can emulate in ~/.profile, doesn t predefine file name. achieve similar semantics csh model, ~/.bash_profile can contain line below, after environment setup , function setup:



likewise, csh has ~/.logout file run when login shell exits. bash equivalent ~/.bash_logout, , requires no special setup. in bourne shell, trap built-in can used achieve similar effect.



legacy-compatible bash startup example

the skeleton ~/.bash_profile below compatible bourne shell , gives semantics similar csh ~/.bashrc , ~/.bash_login. [ -r filename ] tests see if filename exists , readable, skipping part after && if s not.








Comments

Popular posts from this blog

Discography Ole Paus

Gaeta class Lerici-class minehunter

Driver.27s licenses used for identification purposes Driver's license