From 53b55b4b10ef6344a882402d5dcaf11d87b78d3f Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Sat, 19 Mar 2022 19:27:36 +0100 Subject: Initial commit --- .bashrc | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .bashrc (limited to '.bashrc') diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..c0cae3d --- /dev/null +++ b/.bashrc @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# vim:syntax=sh +# .bash main folder. also required in .bash/prompt.sh. +export BBD="${HOME}/.bash" + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return +# don't put duplicate lines in the history. See bash(1) for more options +export HISTCONTROL=ignoredups +# If the sysadmins do not care about history timestamps, let us do that: +[ -z "$HISTTIMEFORMAT" ] && export HISTTIMEFORMAT="%F %T " +# same philosophy, other history settings: +[ -z "$HISTSIZE" ] && export HISTSIZE=10240 +[ -z "$HISTCONTROL" ] && export HISTCONTROL=ignoredups +# stuff before $BBD +# shellcheck disable=SC1090 +[ -r "${HOME}/.byobu/prompt" ] && source "${HOME}/.byobu/prompt" +# shellcheck disable=SC1091 +[ -r "/usr/share/bash-completion/bash_completion" ] && source "/usr/share/bash-completion/bash_completion" + +# The above is absolutely mandatory imho. Now for the rest. +# Do we have our base directory? +[ ! -x "$BBD" ] && return +MYKERN="$(uname -s)" +for i in vars aliases exec prompt;do + # shellcheck disable=SC1090 + if [ -r "${BBD}/${i}.bash" ];then + source "${BBD}/${i}.bash" + else true + fi + if [ "$MYKERN" == "Linux" ];then + # shellcheck disable=SC1090 + if [ -r "${BBD}/${i}.linux.bash" ];then + source "${BBD}/${i}.linux.bash" + else true + fi + fi + # shellcheck disable=SC1090 + if [ -r "${BBD}/${i}.bash.local" ];then + source "${BBD}/${i}.bash.local" + else true + fi +done -- cgit v1.2.3