[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggestion for .bashrc
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: Suggestion for .bashrc |
Date: |
Fri, 31 Dec 2021 09:21:09 +0100 |
i have a sys that produces bash code out of tree's, so i can have aliases
and stuff in separate files, .. just my suggestion
On Fri, Dec 31, 2021, 09:19 Kevin O'Gorman <kevinogorman4@gmail.com> wrote:
> 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)*
>