Location of functions

后端 未结 2 739
余生分开走
余生分开走 2021-01-20 20:28

If I run the declare command it returns some functions

$ declare -F | grep \'f [^_]\'
declare -f dequote
declare -f quote
declare -f quote_readl         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-20 21:21

    To find the file name and line number of a function declaration in bash, use shopt -s extdebug:

    $ shopt -s extdebug
    $ declare -F quote
    quote 143 /usr/share/bash-completion/bash_completion
    

提交回复
热议问题