The base bash shell directory and setup script for bash shell sourcing system
This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
Go to file
Kebler Network System Administrator a15a290328 set default user subdirectory to .shell
get BASH_SHELL_BASE in both profile and bash.bashrc
2021-12-29 21:09:36 -08:00
alias added add-repo-key function 2021-10-28 12:05:56 -07:00
archive fix globbing problem in _find function 2020-12-26 12:18:27 -08:00
env moved ssh to host repo. 2021-02-05 13:10:18 -08:00
function set default user subdirectory to .shell 2021-12-29 21:09:36 -08:00
lang refactored script sourcing exludes to .bash-shell-ignore file 2020-11-18 15:32:09 -08:00
misc added cyan to machine color in prompt 2021-04-14 10:51:17 -07:00
modules additional network shell directories now set by a .network file under the $HOSTNAME host shell directory (for all users) or the same within the USER shell directory for per user networks. Network proceeded by ! indicates the home/lan network of that machine. 2021-11-20 21:20:39 -08:00
setup set default user subdirectory to .shell 2021-12-29 21:09:36 -08:00
test refactor the way the module library is loaded 2020-11-13 10:25:04 -08:00
.bash-shell-ignore add additional ignores for example, template, tmpl extensions 2021-01-14 14:18:56 -08:00
.bash-shell-include refactored to use ignore and include files for finding files to source 2020-11-20 15:47:38 -08:00
.gitignore fix globbing problem in _find function 2020-12-26 12:18:27 -08:00
README.md set default user subdirectory to .shell 2021-12-29 21:09:36 -08:00
TODO.md add support for sourcing for remote shell via ssh. Works for both interactive and non-interactive 2020-11-23 15:14:18 -08:00
load.sh set default user subdirectory to .shell 2021-12-29 21:09:36 -08:00
module.lib set default user subdirectory to .shell 2021-12-29 21:09:36 -08:00
shell.env set default user subdirectory to .shell 2021-12-29 21:09:36 -08:00
startup.sh refactored startup script, removed as function so it can be sourced immediately, needed this so that startup scripts sourced can export to main login environment. 2021-01-30 11:58:19 -08:00

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.