From fce6ab6e0c3c854ce55a0852b8fd008fc7c12229 Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Fri, 6 Mar 2026 12:02:19 +0100 Subject: [PATCH] Add bashrc usage instructions to README Co-Authored-By: Claude Opus 4.6 --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1523257..4f2d48d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,15 @@ This directory contains modular shell configuration files that are automatically ## How It Works -The `~/.bashrc` iterates over all files in `~/.bash.d/` and sources each one that has the **executable bit** set. Non-executable files are silently skipped, which provides a simple way to temporarily disable a configuration (just `chmod -x` the file). +Add the following to the end of your `~/.bashrc`: + +```bash +for file in $HOME/.bash.d/*; do + [[ -x $file ]] && source $file +done +``` + +This iterates over all files in `~/.bash.d/` and sources each one that has the **executable bit** set. Non-executable files are silently skipped, which provides a simple way to temporarily disable a configuration (just `chmod -x` the file). Files are sourced in **lexicographic order**, so numeric prefixes control the load sequence. This matters because later files may depend on functions or variables defined by earlier ones.