在安装IncrediBuild的构建机器上有一些bash脚本正在运行。IncrediBuild的思想是利用网络中所有可用的内核来加快构建过程。
示例shell脚本:
...
ib_console cmake --build .不应更改shell脚本。我想在没有ib_console的机器上运行脚本。是否有可能以某种方式模拟它或转发对cmake的调用?
发布于 2018-03-22 10:09:34
@alex:别名在shell中工作,但在上面的shell脚本中不起作用,因为别名不会在非交互式shell脚本中展开。
有了Why doesn't my Bash script recognize aliases?,我就能修好它。
if ! [ -f 'whereis ib_console' ]; then
ib_console()
{
echo "ib_console dummy: run '$@'..."
$@
echo "ib_console dummy: done"
}
export -f ib_console
fi建议在更新.bashrc后运行“exec”
发布于 2018-03-21 19:58:26
将其放入您的.bashrc文件:
if [ ! -f ´whereis ib_console´ ] then
alias ib_console='$@'
fi解释:
https://stackoverflow.com/questions/49411517
复制相似问题