aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--yash/yashrc6
-rw-r--r--yash/yashrc.d/ver.yash4
3 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9961da71..30183494 100644
--- a/Makefile
+++ b/Makefile
@@ -383,8 +383,10 @@ install-x :
install -pm 0644 -- X/Xresources.d/* "$(HOME)"/.Xresources.d
install-yash : check-yash install-sh
- install -pm 0644 -- yash/yashrc "$(HOME)"/.yashrc
+ install -m 0755 -d -- "$(HOME)"/.yashrc.d
install -pm 0644 -- yash/yash_profile "$(HOME)"/.yash_profile
+ install -pm 0644 -- yash/yashrc "$(HOME)"/.yashrc
+ install -pm 0644 -- yash/yashrc.d/* "$(HOME)"/.yashrc.d
install-zsh : install-sh
install -m 0755 -d -- "$(HOME)"/.zshrc.d
diff --git a/yash/yashrc b/yash/yashrc
index eef82e54..a731c80b 100644
--- a/yash/yashrc
+++ b/yash/yashrc
@@ -1,3 +1,9 @@
# Load POSIX interactive shell startup files, because Yash won't do it if not
# invoked as sh(1)
[ -e "$ENV" ] && . "$ENV"
+
+# Load Bash-specific startup files
+for sh in "$HOME"/.yashrc.d/*.yash ; do
+ [ -e "$sh" ] && . "$sh"
+done
+unset -v sh
diff --git a/yash/yashrc.d/ver.yash b/yash/yashrc.d/ver.yash
new file mode 100644
index 00000000..8bd06e4d
--- /dev/null
+++ b/yash/yashrc.d/ver.yash
@@ -0,0 +1,4 @@
+# Shortcut to show current shell version
+ver() {
+ printf '%s\n' "${YASH_VERSION:-unknown}"
+}