What is FreeBSD's /bin/sh equivalent to bash's:

compgen -A function

which lists the names of the declared functions.


FreeBSD's /bin/sh is the Almquist shell, and it has no equivalent to that because the Almquist shell does not have programmable command completion in the first place.

However, if you were looking for an equivalent for typeset -F you would still be out of luck. The Almquist shell has no built-in command for listing the names of available shell functions.

This is in fact the same question as "ash: List functions" and "dash: List declared functions". The Debian Almquist shell, the FreeBSD Almquist shell, and the BusyBox Almquist shell are all the Almquist shell. Whilst there are differences amongst them (in particular the setvar builtin, the let builtin, and suchlike) they do not extend to a difference in this respect.

In fact, no flavour of the Almquist shell has this. So you probably do not need to ask this a fourth time about another Almquist shell. ☺

Further reading

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.