Can I view the "source" for the ksh function?

Our ksh environment defines several functions. The names of these functions can be listed using the typeset -fksh command (or an alias functions). Is it possible to see the definition (i.e. source code) for these functions?

This seems like an obvious question, but I have not tried using all the parameters typeset -f.

As an example (on Linux):

$ foo()
> {
>  echo foo
> }
$ foo
foo
$ typeset -f foo
foo
$

For some (but not all) other functions defined by default in the environment, the typeset -fsource shows.

Update 1: This happens with the Linux kernel 2.4.21-32

Update 2: Update 2: Ctrl-V gives "Version M 1993-12-28 n +" - it looks like this is a rather old version, so there may not have been the fixes mentioned by Gilles below

Thanks Steve

+5
2

ksh, , . ksh93:

08-01-31 --- ksh93s + ---
07-11-01 , - fun            , .

03-03-18 --- ksh93o ---
03-02-28 -f            , . , tyet + f            , ,            , .

+2

, typeset -f <function-name>, :

$ foo
foo
$ typeset -f foo
function foo
{
    echo foo
}

typeset -f .

+2

All Articles