Adjusting Shell Behavior and Environment

Problem

You want to adjust your shell environment to account for the way you work, your physical location, your language, and more.

Solution

See the table in the section “Adjusting Shell Behavior Using set, shopt, and Environment Variables” in Appendix A.

Discussion

There are three ways to adjust various aspects of your environment. set is standardized in POSIX and uses one-letter options. shopt is specifically for bash shell options. And there are many environment variables in use for historical reasons, as well as for compatibility with many third-party applications. How you adjust what and where, can be be very confusing. The table in the section “Adjusting Shell Behavior Using set, shopt, and Environment Variables” in Appendix A will help you sort it out, but it’s too big to duplicate here.

See Also

Get bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.