core base shell repo including setup scripts. The repo constitues a minimal install
Go to file
David Kebler 057b8ad9dd fix again suppress latest links. avoid remote targets
fix created error where no sshargs does not add ssh command
2024-03-20 11:26:55 -07:00
install fix sudo elevation 2024-02-27 19:37:44 -08:00
load add commandline git discard alias 2024-03-13 10:13:08 -07:00
modules fix again suppress latest links. avoid remote targets 2024-03-20 11:26:55 -07:00
.bash-shell-ignore ignore .inst and .uninst files 2023-12-14 13:59:24 -08:00
.bash-shell-include refactor: more new session loading to anything under "load" subirectory (by default) still can add additional loading directories as before. 2023-02-22 11:39:34 -08:00
.gitignore update for using module.base instead of module.lib 2023-12-20 17:21:48 -08:00 improve module base - use stderr for error messages 2024-02-21 11:11:07 -08:00 load adds a 'which' function if 'which' command is missing 2024-02-12 18:10:17 -08:00
make-module-base use which instead of command -v 2024-03-01 15:01:47 -08:00
module.base whoops fixed call of which in module_confirm 2024-03-01 15:15:16 -08:00
module.base.src whoops fixed call of which in module_confirm 2024-03-01 15:15:16 -08:00
shell.env refactor module library 2023-12-17 12:54:45 -08:00 feat: clean up shell.env, improved comments, added in BAHS_SHELL_DEV repo /opt/shell default 2022-03-01 22:45:40 -08:00

Bash Shell Organizer

A better way to keep your shell setup organized, clean, and useful

interactive (.bashrc) environment, aliases, functions, modules


Clone to a directory

git clone <repo path> suggestion: /opt/shell/base

The idea is to keep the .bashrc file completely clean and manage this repo instead so you should really find a home for all the existing content of your .bashrc file within the repo

Every file in env functions,aliases and misc subdirectories will be sourced in that order (in Within each folder all files are sourced except ones ending with a .off extension, starting with . and the file plus any in any subfolder except /archive or /dep

The sourced files in this repo should be NOT be user/machine/network specific

if you include any of these environment variables all files in there directories will be sourced where

unless below specific directories are set

shell files are sourced in this order

sourced via /etc/bash.bashrc so for all machine users

$BASH_SHELL_BASE # this is set in /etc/bash.bashrc and etc/profile via the deploy script





sourced via $HOME/.bashrc


within each of those directories if exits it will be run

otherwise files will be sourced exactly like in the base

identify a network name that this host resides on

like hostname but for the LAN network

if unset then only /all will be sourced

export NETWORKNAME=238

will use $BASH_SHELL_NETWORK/$NETWORKNAME under this directory unless specifically set


will use $BASH_SHELL_HOST/ unless specifically set


by default SHELL sources will be looked for under $HOME/shell

but can be user set below to BASH_SHELL_USER_DIR

export BASH_SHELL_USER=<some directory under $HOME>

if there is a script in the root of these directoies it will be run. If not then all files no matter how deep will be sourced in alpha order order.

For those

If need to turn off a file just add .off to the file name rather than move or delete the file...simple.

If you are really done with something but want to keep a copy in the repo move it to /archive folder within the primary subfolders

if sourcing some file depends on another preface with numbers to put it before. Functions are all sourced before aliases so can be referred to there.

Be aware that an alias or function set in the repo could be subsuming some existing binary or script.

interactive non-login shells source /etc/profile via /etc/bash.bashrc otherwise non-interactive non-login shells only load a basic path and access to the module library. One needs to one off source the modules needed for the script. Aliases too are not loaded in this case.

Thus for non-interactive/non-login shells it is best to symlink a non-module file/directory in modules folder in order to give access to non-interactive shells


  • conditionally create a which functionin shell.env if which command is not availble. which being pretty much the same ascommand -v cmd`