Package: ksh Version: 93u+20120801-3.1 Severity: normal I previously reported this problem as issue #821806: However, I think I initially misunderstood the problem to the extent that the information in that issue may be misleading.
Korn Shell provides a feature that allows the user to load shared objects into the shell process as new commands that will be integrated into the shell environment. The commands loaded in this way have the same functionality as "built-in" commands internal to the shell, including the ability to manipulate shell variables and file descriptors. The feature is used like this: $ ksh $ builtin -f <path to shared object> <command name> If successful, the newly-loaded command may be run within the shell. Debian's ksh package appears to contain mostly just those sources needed to build Korn Shell itself. The current home of the upstream sources, however, contains a more complete set of related sources: https://github.com/att/ast Among other things, this repository includes working examples of loadable "built-in" libraries, and the dynamic libraries needed to allow these modules to interface with the shell: src/cmd/kshlib/: Contains source code for examples of loadable built-ins src/lib/libast/: Source for libast.so src/lib/libcmd/: Source for libcmd.so src/lib/libdll/: Source for libdll.so src/lib/libcoshell/: I believe this is the directory that provides source for libshell.so The four libraries (libast.so, libcmd.so, libdll.so, and libshell.so) are necessary in order to load the libraries built from src/cmd/kshlib/. When built properly, the modules can be loaded and used as follows: $ builtin -f arch/linux.i386-64/lib/ksh/libcmdtst.so # Provides "xargs" and various forms of "grep" as builtins $ builtin grep && echo "grep is builtin" grep is builtin $ grep --help (...Help text demonstrates that "grep" is no longer GNU grep) $ builtin -f arch/linux.i386-64/lib/ksh/libopen.so open $ open -r fd /etc/passwd $ echo $fd ( atime='Sun Jun 11 18:35:02 EDT 2017' ctime='Sun Jun 11 18:35:02 EDT 2017' dev=2050 fd=4 gid=0 ino=2885926 mode=u='rw,g=r,o=r' mtime='Sun Jun 11 18:35:02 EDT 2017' name=/etc/passwd nlink=1 size=2052 uid=0 ) I am not sure why, but when I have built loadable modules from the upstream "ast" source tree, I have been unable to load and use them in Debian's version of ksh. (I usually get a segfault.) But I can load them into the ksh binary built from the "ast" source tree. -- System Information: Debian Release: stretch/sid APT prefers testing APT policy: (500, 'testing'), (500, 'stable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.5.0-2-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages ksh depends on: ii binfmt-support 2.1.6-1 ii libc6 2.24-9 ksh recommends no packages. ksh suggests no packages. -- no debconf information