Package: bash
Version: 5.0-4
Severity: wishlist
Tags: patch

In ~/.profile add support for custom configuration files stored in
~/.bashrc.d/* alongside ~/.bashrc

Patch for /etc/skel/.profile in the attachment.

# include all files from .bashrc.d/
if [ -d "$HOME/.bashrc.d" ]; then
    for rc in "$HOME/.bashrc.d/"*; do
        if [ -f "$rc" ]; then
            . "$rc"
        fi
    done
fi
diff -U 100 -H -d -r -N -- data1/etc/skel/.profile data2/etc/skel/.profile
--- data1/etc/skel/.profile
+++ data2/etc/skel/.profile
@@ -11,9 +11,17 @@
 # if running bash
 if [ -n "$BASH_VERSION" ]; then
     # include .bashrc if it exists
     if [ -f "$HOME/.bashrc" ]; then
-	. "$HOME/.bashrc"
+        . "$HOME/.bashrc"
+    fi
+    # include all files from .bashrc.d/
+    if [ -d "$HOME/.bashrc.d" ]; then
+        for rc in "$HOME/.bashrc.d/"*; do
+            if [ -f "$rc" ]; then
+                . "$rc"
+            fi
+        done
     fi
 fi
 
 # set PATH so it includes user's private bin if it exists

Reply via email to