【发布时间】:2016-04-21 12:39:18
【问题描述】:
这是我用来“全局”运行 grunt 的脚本。它在 bash shell 中,所以需要更多上下文,所以我想要返回字符,以便在运行 beast watch 时它更“安静”。
beast() {
cd ~/root_install/grunt
local a="$1"
if [ $# -eq 0 ]
then
grunt &
fi
if [ $# -eq 1 ]
then
grunt "$a" &
fi
cd ~/root
}
这部分我想要一个返回字符:
grunt "$a" &
在&之后
【问题讨论】:
-
使用
grunt "$@"要简单得多。