aboutsummaryrefslogtreecommitdiff
path: root/ksh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-19 13:18:16 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-19 13:18:16 +1300
commit7e40448c18bba4317837264ca1eb283783205386 (patch)
tree7c20204f4927f1659cfae3d588b2043fd9338936 /ksh
parentd8c336c02edeed19590b75772dd66e81d684bbe5 (diff)
downloaddotfiles-7e40448c18bba4317837264ca1eb283783205386.tar.gz
Request version with "ver" shortcut not prompt
Diffstat (limited to 'ksh')
-rw-r--r--ksh/kshrc.d/prompt.ksh14
-rw-r--r--ksh/kshrc.d/ver.ksh4
2 files changed, 6 insertions, 12 deletions
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}"
+}