Full descriptions at links. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238065 https://forums.freebsd.org/threads/ksh-vs-sh-built-in-commands.70947/
ksh93 is a part of a larger tookit called AST ( AT&T Software Technology ) and along with it there are some utilities built-in with the shell: > whence -v date date is a shell builtin version of /bin/date > whence -a date date is a shell builtin version of /bin/date There are quite a few of them: builtin | grep /opt/ast/bin > builtin | grep /opt/ast/bin | sed 's,/opt/ast/bin/,,' | paste - - - - basename cat chgrp chmod chown cksum cmp comm cp cut date dirname egrep expr fds fgrep fmt fold getconf grep head iconv id join ln logname ls md5sum mkdir mkfifo mktemp mv od paste pathchk pids readlink realpath rev rm rmdir sha1sum sha256sum sha2sum sha384sum sha512sum stty sum sync tail tee tr tty uname uniq vmstate wc xargs xgrep (in reality, not all of them are availbe - chmod is but chown isn't). Here is an excerpt from the description The stanadlone ksh is statically linked with the ast libcmd library which provides several builtin versions of /bin commands. "builtin | grep /opt/ast/bin" lists the libcmd builtins on the standard output. /opt/ast/bin/FOO accesses the FOO builtin, whether the /opt/ast/bin directory exists or not. "builtin FOO" allows /opt/ast/bin/FOO to be accessed as FOO, bypassing the $PATH setting. To enable all libcmd builtins do one of the following: (a) create the directory /opt/ast/bin and the file /opt/ast/bin/.paths with this line BUILTIN_LIB=. and place /opt/ast/bin before /bin and /usr/bin in $PATH (this will affect all ksh subshells and scripts) (b) run "builtin $( builtin | sed -e '/\//!d' -e 's,.*/,,' )" (this will affect only the current shell) Some scripts may run significantly faster with libcmd builtins enabled. The point here is to have a consistent set of mostly used utilities and to make ksh93 run much faster. I think I have inadvertedly changed the way ksh93 was built and that might have enabled the builtins. Need to check. I guess the new port (formerly ksh93-devel) does not have this issue.
Re-classifying/opening the original bug 238065 would have been preferred, but since this has already been created, we'll carry on here.
(In reply to Marcin Cieślak from comment #1) I figured it was something like that. I had seen unexpected results from date, fgrep, and tail. After yesterday's ksh93 update, the problems are gone for me. Jun 3 04:28:19 hhh pkg[22582]: ksh93 upgraded: 20141224 -> 2020.0.0.a1,1 Now I see: $ whence -v date date is a tracked alias for /bin/date $ whence -a date date is a tracked alias for /bin/date Thanks!
Good question whether this is a bug or feature. I think we should close this since this no longer occurs with ksh93 alpha.
Fixed as up update to 2020.0.0.