1
如何將功能名稱顯示到功能中?如何在功能本身顯示功能名稱
#!/bin/sh
toto()
{
echo "$something"
}
toto
上面的代碼應該顯示
toto
我米使用距離的busybox
如何將功能名稱顯示到功能中?如何在功能本身顯示功能名稱
#!/bin/sh
toto()
{
echo "$something"
}
toto
上面的代碼應該顯示
toto
我米使用距離的busybox
慶典Linux可以使用$FUNCNAME
這樣做。
$ toto()
> {
> echo "this function name is $FUNCNAME"
> }
$ toto
this function name is toto
這種方式更適合我的Ubuntu的外殼,但它並不適用於BusyBox的bash的工作 – MOHAMED
UHMS恐怕是不可能的,那麼。請參閱http://www.mail-archive.com/[email protected]/msg01550.html – fedorqui
我相信BusyBox使用'ash'而不是'bash'。在2.0版本中'FUNCNAME'被添加到'bash'中,所以它不太可能是版本問題。 – chepner