Skip to content

Comment on Ask HN:What does your bash_profile look like?

Comments

My actual~/.bash_profile file is very minimal, it just sources each file in ~/.bash/ in turn.

You can see the organized contents of that directory here:

https://github.com/skx/dotfiles/tree/master/.bash/

Thanks, your "x" function looks useful. May I ask about the organization? Why the NN- prefix for filenames? Some type of standard I'm not aware of?

When the contents of .bash are sourced it will be done in filename order. Some files might rely on others being sourced first. So using the numeric prefix allows controlling the order while still having meaningful names.

I tend to do that when I'm using run-parts, or similar processing over a directory of files that will all be read. It ensures that files are always loaded in a predictable order.

Usually it doesn't matter, but if you have dependencies it allows you to express them in a simple fashion. (e.g. defining a function in one file, and using it in another.)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.