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.
为什么下面的代码会给我标题中的错误?
_say_hey() { echo "hey" } echo "$(_say_hey())"
调用函数时,像普通命令一样调用它(去掉括号):
echo "$(_say_hey)"
注意echo这里是多余的;你可以单独写_say_hey一行来达到同样的效果。
echo
_say_hey