bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestion for .bashrc


From: Kevin O'Gorman
Subject: Suggestion for .bashrc
Date: Thu, 30 Dec 2021 20:46:16 -0800

I see the bash web page on Xubuntu gives this email address for requests
and such.  Nice.  It also gives a usenet group as an alternative.  I did
not know usenet was still around.

Anyway, my problem is thatI have so many things added to my .bashrc (well
to .bash_aliases really), and they've become corrupted and tangled over
time, that I am reluctant to even look at it.  That's not your fault, of
course, but there's a simple path that might reduce the likelihood of this
happening, and not just for me.

It's inspired by the change over time from files named "conf" in favor of
directories named conf.d.
Things can just be dropped into the directory and they don't have to mess
with each other.  They
can have descriptive names.   They can be short.

So I propose extending  the stanza near the end of .bashrc:
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

by following it with
for __bash_alias in ~/.bash_aliases.d/* ; do
    if [ -f $__bash_alias ]; then
        source $__bash_alias
    fi
done

This would make it possible to keep all of the additions in separate
files.  It even works for
me if the directory is empty or does not exist, so it does not clutter up
the dotfile space of folks who don't use it.

*Kevin O'Gorman (he/him/his)*


reply via email to

[Prev in Thread] Current Thread [Next in Thread]