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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.