Bash Shell Scripting/Some Notes On Your Shell

Shell version
This textbook provides information for those commonly-available versions of Bash, as of December 2021, this should be Bash version 5. Using an earlier version of Bash will make you fail to try some features out.

The Bash, version 3.2, included in OS X is quite important to mention. A really noticeable change for some users may be the missing  option which enables interpretation of backslash escapes, an important feature for color printing. Although this can be done using a workaround (e.g. using  instead), this can be quite inconvenient.

Consider getting the source from http://www.gnu.org/software/bash/ and compile one.


 * Bash 4.3.18 for OS X 10.8+, built by Arthur200000: Baidu Download Link. Read KNOWN_ISSUES before you download. Just look for '下载', it means 'Download'.

bashrc
The  file determines the behavior of interactive shells, and having it properly configured can make life easier.

Most GNU/Linux distros have the  file. Use your favourite text editor to explore it.

In most cases, there is also a global  file, usually located at. Try changing it, if you are root. If you don't know what to do, take a look at those s:
 * Advanced Bash Scripting:Sample Bashrc
 * A Modified version of The BLFS /etc/bashrc