Location of functions

后端 未结 2 738
余生分开走
余生分开走 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
    
    0 讨论(0)
  • 2021-01-20 21:31

    They are part of Bash-Completion

    $ egrep '^(dequote|quote)'  /usr/share/bash-completion/bash_completion 
    quote()
    quote_readline()
    dequote()
    
    0 讨论(0)
提交回复
热议问题