env
and printenv
are both external commands i.e. executable files, not bash builtins.
The problem with them is that some environment variables (such as _
, and I also wonder if there are more) which they output don’t belong to the shell which invokes them, see here.
The yash
shell has a printf
built-in, according to its manual.
Some commands are provided as both builtins and external utilities. Take echo
for example. On my machine (macOS) running Bash 3.2,
eval
and exec
are both built in commands of bash(1) that execute commands.
Consider this from the documentation of Bash’ builtin exec: