What is FreeBSD's
/bin/sh equivalent to
compgen -A function
which lists the names of the declared functions.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
/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. ☺