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

Directory for bash profile snippets?



Hi,

I am thinking about where would be the right place to put in some
systemwide (not user dependent, though the problems stays nearly the
same, with /home/user instead of /etc) snippets for bash, which depent
upon existence of a package.

For example if I would like fbi to alwyas be called with the same
parameters, then I would define an alias in a file (/foo.d/fbi-alias)
like:

#!/bin/bash
alias fbi='fbi -switch1 -switch2 $@'

and would like to source the file upon bash start.

So there seem to be 2 problems, now that I am thinking about it:

1. Is there a possibility to drop such snippets for bash
(/etc/bash_completion.d does not seem to be the right thing)?

2. How do I tell bash to source those snippets upon start?

Until now I used something like:

/etc/bash.bashrc:
[... original debian stuff ...]

if [ -r /etc/bash.bashrc.local ]; then
        . /etc/bash.bashrc.local
fi

But I don't like the idea to have to change the original bashrc, which
is problematic when installing new bash packages.

W. la Tendresse




Reply to: