Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将函数名显示到函数中?
#!/bin/sh toto() { echo "$something" } toto
上面的代码应该显示
toto
我正在使用来自busybox的bash linux
你可以使用$FUNCNAME这样做。
$FUNCNAME
$ toto() > { > echo "this function name is $FUNCNAME" > } $ toto this function name is toto