core base shell repo including setup scripts. The repo constitues a minimal install
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kebler Network System Administrator e02a7c71fb added add-ppa module. use instead of apt-add repository. 1 month ago
alias add: tools to shell directory includes 10 months ago
env add: tools to shell directory includes 10 months ago
function add functions osinfo adduserid () fsudo () to basic 1 month ago
lang refactored script sourcing exludes to .bash-shell-ignore file 2 years ago
misc added cyan to machine color in prompt 2 years ago
modules added add-ppa module. use instead of apt-add repository. 1 month ago
setup load only base and any host when coming from ssh 7 months ago
.bash-shell-ignore add: tools to shell directory includes 10 months ago
.bash-shell-include add: tools to shell directory includes 10 months ago
.gitignore fix globbing problem in _find function 2 years ago
README.md feat: clean up shell.env, improved comments, added in BAHS_SHELL_DEV repo /opt/shell default 9 months ago
TODO.md add support for sourcing for remote shell via ssh. Works for both interactive and non-interactive 2 years ago
load.sh load only base and any host when coming from ssh 7 months ago
module.lib add module copy module_cp to module library 1 month ago
shell.env feat: clean up shell.env, improved comments, added in BAHS_SHELL_DEV repo /opt/shell default 9 months ago
startup.sh feat: clean up shell.env, improved comments, added in BAHS_SHELL_DEV repo /opt/shell default 9 months ago

README.md

Bash Shell Organizer

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

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

Install

Clone to a directory

git clone https://git.kebler.net/bashrc <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 setup.sh). Within each folder all files are sourced except ones ending with a .off extension, starting with . and the README.md 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

$BASH_SHELL_NETWORK/all

$BASH_SHELL_NETWORK/$NETWORKNAME

$BASH_SHELL_HOST/all

$BASH_SHELL_HOST/

sourced via $HOME/.bashrc

$HOME/shell or $HOME/BASH_SHELL_USER

within each of those directories if setup.sh 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

export BASH_SHELL_NETWORK=$BASH_SHELL/network

will use $BASH_SHELL_HOST/ unless specifically set

export BASH_SHELL_HOST=$BASH_SHELL/host

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

but can be user set below to $HOME/$BASH_SHELL_USER

export BASH_SHELL_USER=<some directory under $HOME>

if there is a script setup.sh 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