aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-10 11:17:37 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-10 11:17:37 +1200
commitfc7ccd48bec1bd6ea8201533977e154ae4d94aaa (patch)
tree9335a2d5f5832741f5a97e491620e199e7569144
parentLimit prompt setup to OpenBSD pdksh (diff)
downloaddotfiles-fc7ccd48bec1bd6ea8201533977e154ae4d94aaa.tar.gz
dotfiles-fc7ccd48bec1bd6ea8201533977e154ae4d94aaa.zip
Name/point pdksh files specifically
This frees up space to implement actual ksh88/ksh93 files specifically in future, as pdksh's feature set differs considerably
-rw-r--r--Makefile8
-rw-r--r--pdksh/kshrc14
-rw-r--r--pdksh/pdkshrc14
-rw-r--r--pdksh/pdkshrc.d/prompt.pdksh (renamed from pdksh/kshrc.d/prompt.ksh)0
-rw-r--r--sh/profile.d/env.sh14
-rwxr-xr-xtest/pdksh8
6 files changed, 30 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index ce19001f..937e9528 100644
--- a/Makefile
+++ b/Makefile
@@ -209,11 +209,11 @@ install-i3 : install-x
install -m 0755 -d -- "$(HOME)"/.i3
install -pm 0644 -- i3/* "$(HOME)"/.i3
-install-pdksh : test-pdksh
+install-pdksh : test-pdksh install-sh
install -m 0755 -d -- \
- "$(HOME)"/.kshrc.d
- install -pm 0644 -- pdksh/kshrc "$(HOME)"/.kshrc
- install -pm 0644 -- pdksh/kshrc.d/* "$(HOME)"/.kshrc.d
+ "$(HOME)"/.pdkshrc.d
+ install -pm 0644 -- pdksh/pdkshrc "$(HOME)"/.pdkshrc
+ install -pm 0644 -- pdksh/pdkshrc.d/* "$(HOME)"/.pdkshrc.d
install-maildir :
install -m 0755 -d -- \
diff --git a/pdksh/kshrc b/pdksh/kshrc
deleted file mode 100644
index c0697774..00000000
--- a/pdksh/kshrc
+++ /dev/null
@@ -1,14 +0,0 @@
-# Emacs-style key bindings
-set -o braceexpand
-set -o emacs
-
-# Save history
-HISTFILE=$HOME/.sh_history
-HISTSIZE=$((1 << 12))
-
-# Load any supplementary scripts
-for kshrc in "$HOME"/.kshrc.d/*.ksh ; do
- [[ -e $kshrc ]] || continue
- . "$kshrc"
-done
-unset -v kshrc
diff --git a/pdksh/pdkshrc b/pdksh/pdkshrc
new file mode 100644
index 00000000..46dbba2c
--- /dev/null
+++ b/pdksh/pdkshrc
@@ -0,0 +1,14 @@
+# Emacs-style key bindings
+set -o braceexpand
+set -o emacs
+
+# Save history
+HISTFILE=$HOME/.pdksh_history
+HISTSIZE=$((1 << 12))
+
+# Load any supplementary scripts
+for pdkshrc in "$HOME"/.pdkshrc.d/*.pdksh ; do
+ [[ -e $pdkshrc ]] || continue
+ . "$pdkshrc"
+done
+unset -v pdkshrc
diff --git a/pdksh/kshrc.d/prompt.ksh b/pdksh/pdkshrc.d/prompt.pdksh
index d261b90d..d261b90d 100644
--- a/pdksh/kshrc.d/prompt.ksh
+++ b/pdksh/pdkshrc.d/prompt.pdksh
diff --git a/sh/profile.d/env.sh b/sh/profile.d/env.sh
index ba8e7f49..f1b83919 100644
--- a/sh/profile.d/env.sh
+++ b/sh/profile.d/env.sh
@@ -1,8 +1,10 @@
-# If we're running some kind of ksh, export ENV to find ~/.kshrc. Bash differs
-# considerably from this behaviour; it uses ENV as its startup file when it's
-# invoked as sh(1), and uses .bashrc or --rcfile as its interactive startup
-# file, so it doesn't need to be specified here.
-if [ -n "$KSH_VERSION" ] ; then
- ENV=$HOME/.kshrc
+# If we're running some kind of ksh, export ENV to find a suitable startup
+# file. Bash differs considerably from this behaviour; it uses ENV as its
+# startup file when it's invoked as sh(1), and uses .bashrc or --rcfile as its
+# interactive startup file, so it doesn't need to be specified here.
+case $KSH_VERSION in
+ *'PD KSH '*) ENV=$HOME/.pdkshrc ;;
+esac
+if [ -n "$ENV" ] ; then
export ENV
fi
diff --git a/test/pdksh b/test/pdksh
index 5ebd556a..fd1d55b7 100755
--- a/test/pdksh
+++ b/test/pdksh
@@ -1,6 +1,6 @@
#!/bin/sh
-for ksh in ksh/* ; do
- [ -f "$ksh" ] || continue
- ksh -n "$ksh" || exit
+for pdksh in pdksh/* pdksh/pdkshrc.d/* ; do
+ [ -f "$pdksh" ] || continue
+ ksh -n "$pdksh" || exit
done
-printf 'All ksh(1) scripts parsed successfully.\n'
+printf 'All pdksh scripts parsed successfully.\n'