aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bashrc.d/ver.bash4
-rw-r--r--ksh/kshrc.d/prompt.ksh14
-rw-r--r--ksh/kshrc.d/ver.ksh4
-rw-r--r--zsh/zshrc.d/ver.bash4
4 files changed, 14 insertions, 12 deletions
diff --git a/bash/bashrc.d/ver.bash b/bash/bashrc.d/ver.bash
new file mode 100644
index 00000000..30a546b2
--- /dev/null
+++ b/bash/bashrc.d/ver.bash
@@ -0,0 +1,4 @@
+# Shortcut to show current shell version
+ver() {
+ printf '%s\n' "${BASH_VERSION:-unknown}"
+}
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index 719b119f..8b460136 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -19,8 +19,8 @@ function prompt {
fi
# Add sub-commands; working directory with ~ abbreviation, VCS,
- # job, and ksh version code
- PS1=$PS1'$(prompt pwd)$(prompt vcs)$(prompt job)$(prompt ver)'
+ # and job count
+ PS1=$PS1'$(prompt pwd)$(prompt vcs)$(prompt job)'
# If this is PDKSH, add the exit code of the previous command; this
# doesn't seem to work on ksh93, probably different timing for when
@@ -200,16 +200,6 @@ function prompt {
((jobc)) && printf '{%u}' "$jobc"
;;
- # Show a short code denoting the ksh flavour, if it can be gleaned from
- # KSH_VERSION
- ver)
- case $KSH_VERSION in
- *'PD KSH'*) printf %s ':pd' ;;
- *'MIRBSD KSH'*) printf %s ':mk' ;;
- *' 93'*) printf %s ':93' ;;
- esac
- ;;
-
# Print error
*)
printf 'prompt: Unknown command %s\n' "$1" >&2
diff --git a/ksh/kshrc.d/ver.ksh b/ksh/kshrc.d/ver.ksh
new file mode 100644
index 00000000..68602a8d
--- /dev/null
+++ b/ksh/kshrc.d/ver.ksh
@@ -0,0 +1,4 @@
+# Shortcut to show current shell version
+function ver {
+ printf '%s\n' "${KSH_VERSION:-unknown}"
+}
diff --git a/zsh/zshrc.d/ver.bash b/zsh/zshrc.d/ver.bash
new file mode 100644
index 00000000..c307e6ed
--- /dev/null
+++ b/zsh/zshrc.d/ver.bash
@@ -0,0 +1,4 @@
+# Shortcut to show current shell version
+ver() {
+ printf '%s\n' "${ZSH_VERSION:-unknown}"
+}