Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mksh/ksh MirBSD ksh version available from shell variable $KSH_VERSION #182

Open
BrianInglis opened this issue Aug 30, 2024 · 0 comments
Open

Comments

@BrianInglis
Copy link

The mksh/ksh MirBSD portable ksh version is available from the shell variable $KSH_VERSION.
This should be added to the lib/versions script in a suitably portable manner, and also support for /bin/mksh?
As this is on a Cygwin system, it is currently finding the mksh MS Windows manifest version instead, which is amusing, but not helpful.
This variable was found using strings /bin/ksh | grep -i version and confirmed from the command and man page.

$ /bin/ksh -c 'echo $KSH_VERSION'
@(#)MIRBSD KSH R56 2018/01/14
$ /bin/mksh -c 'echo $KSH_VERSION'
@(#)MIRBSD KSH R56 2018/01/14
$ man mksh
...
KSH_VERSION The name and version of the shell (read‐only).
See also the version  commands  in  “Emacs  editing mode” and
“Vi editing mode” sections, below.
...
Emacs editing mode
...
version: ^[^V
Display the version of mksh.
The current edit buffer is restored as soon as  a  key  is  pressed.
The restoring keypress is processed, unless it is a space.
...
Vi editing mode
...
^V Display the version of mksh.
The current edit buffer is restored as soon as a key is pressed.
The restoring keypress is ignored.

You might also want to consider supporting posh:

$ /bin/posh -c 'echo $POSH_VERSION'
0.14.1
$ man posh
...
NAME
	posh - Policy-compliant Ordinary SHell
...
DESCRIPTION
	posh is a reimplementation of the Bourne shell,
	a command interpreter for both interactive and script use.
...
AUTHORS
	This shell is based on pdksh.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant