From: Oleg Broytman Date: Thu, 27 Aug 2020 00:14:58 +0000 (+0300) Subject: .shellrc: Allow to path arguments to `include` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=2fbbd0de411d74acf77dab627249224fea127317;p=dotfiles.git .shellrc: Allow to path arguments to `include` --- 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