From 2fbbd0de411d74acf77dab627249224fea127317 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 27 Aug 2020 03:14:58 +0300 Subject: [PATCH] .shellrc: Allow to path arguments to `include` --- .shellrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.shellrc b/.shellrc index 167af7b..7388d5a 100644 --- a/.shellrc +++ b/.shellrc @@ -330,12 +330,13 @@ fi include() { cfg="$1" + shift if [ -f "./$cfg" -a -r "./$cfg" ]; then echo "Reading config file \`$cfg'" 1>&2 - . "./$cfg" + . "./$cfg" "$@" elif [ -f "$HOME/lib/config/$cfg" -a -r "$HOME/lib/config/$cfg" ]; then echo "Reading config file \`$HOME/lib/config/$cfg'" 1>&2 - . "$HOME/lib/config/$cfg" + . "$HOME/lib/config/$cfg" "$@" else echo "Cannot find config file \`$cfg'" 1>&2 fi -- 2.39.5