2013-07-17 154 views

回答

5

慶典Linux可以使用$FUNCNAME這樣做。

$ toto() 
> { 
> echo "this function name is $FUNCNAME" 
> } 
$ toto 
this function name is toto 
+0

這種方式更適合我的Ubuntu的外殼,但它並不適用於BusyBox的bash的工作 – MOHAMED

+0

UHMS恐怕是不可能的,那麼。請參閱http://www.mail-archive.com/[email protected]/msg01550.html – fedorqui

+2

我相信BusyBox使用'ash'而不是'bash'。在2.0版本中'FUNCNAME'被添加到'bash'中,所以它不太可能是版本問題。 – chepner