Display bash shell function definitions with declare/typeset 

Joined:
04/07/2009
Posts:
172

February 16, 2012 14:57:35    Last update: February 16, 2012 14:57:35
You can use either declare or typeset to list function definitions:
  1. To list all function names:
    declare -F
    

  2. To display a function definition:
    $ declare -f quote
    quote () 
    { 
        echo \'${1//\'/\'\\\'\'}\'
    }
    



If you see a lot of functions with names starting with the underscore (_) and wonder where they come from, they are created by the scripts in /etc/bash_completion.d/.
Share |
| Comment  | Tags