功能位置 [英] Location of functions
本文介绍了功能位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我运行declare
命令,它将返回一些功能
If I run the declare
command it returns some functions
$ declare -F | grep 'f [^_]'
declare -f dequote
declare -f quote
declare -f quote_readline
但是,如果我运行此命令,它将找不到具有该功能的任何文件
However if I run this command it does not find any files with that function
grep -r dequote /etc ~
如何找到定义这些功能的文件?
How can I find the files that define these functions?
推荐答案
要在bash中查找函数声明的文件名和行号,请使用shopt -s extdebug
:
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
这篇关于功能位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文