Who decides or how are shell options (defaults) configured?

set | less
set | wc -l

If you use the terminal alot, you’re familiar with files like ‘.bashrc’, ‘.zshrc’, ‘.profile’, etc. I’m interested in understand where the shell options are configured outside of the standard ‘/etc’ and what many people refer to as dotfiles. I assume they must either be compiled in or packaged with your shell, and if you use one a set of completions.

A freshly installed CentOS system has ~25 lines of shell options pre-set, but my fedora 32 laptop has over 6000 lines. Each line is not a shell option, many are shell functions. Do you ever audit your shell options? Have shell options ever caused a problem for your servers? Are there good ‘hygiene’ practices for shell options on servers?

I realize these are pretty big questions, I’m happy to have a go at reading some C libraries if I need to, but hoping for something a bit easier to parse for me to dig into.

Thanks!

If you have bash-completion installed, that defines a lot of functions. I have also have gawk installed and it defines a couple of functions too. Packages drop shell configuration files to /etc/profile.d and completion related files to /etc/bash_completion.d directories, you can check them to audit.

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.