By default, Macintosh OSX does not read the .bashrc file when you login to the operating system. But it does read the .bash_profile script if it does exist. Therefore, create the .bash_profile in your home directory and put this in it.
if [ -s ~/.bashrc ]; then source ~/.bashrc; fi |
Then the .bashrc file will be read and used when you login and open a terminal window. This allows the usage of custom PS1 and other useful things like aliases. This is better than typing source ~/.bashrc
every time you wish to use it.
Some very useful bash shell tips for beginners.
https://www.securitronlinux.com/lc/ShellIntro.pdf.
Advanced Linux documentation that could also be applicable to Macintosh OSX.
https://www.securitronlinux.com/lc/rute/.
The default /etc/bashrc file for Mac OSX.
jason@. PWD: ~. -bash. 3.2.57. 14 $> cat /etc/bashrc # System-wide .bashrc file for interactive bash(1) shells. if [ -z "$PS1" ]; then return fi PS1='\h:\W \u\$ ' # Make bash check its window size after a process completes shopt -s checkwinsize [ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM" |
There is not much in it at all.
The /etc/bashrc_Apple_Terminal file is more comprehensive. This is good to look at, and could yield some ideas for bash scripting.