Displaying functions

If you want to see all the declared functions in the shell environment, then enter the following command:

    $ declare -f
  

If you want to see a particular function, then here is the command:

    $ declare -f hello
  

This should produce the following output:

    hello ()
    {
        echo 'Hello world!'
    }
  

Get Learning Linux Shell Scripting - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.