从ant脚本执行.sh文件时权限被拒绝

时间:2016-02-11 12:05:31

标签: shell

我正在尝试从ant文件执行shell脚本,但它给出的错误如下:      [exec] / bin / sh:./ abc.sh:权限被拒绝      [exec]结果:126

我的代码段是:

<exec dir="." executable="/bin/sh">
                <arg line="-c './abc.sh -s ${arg1}'" />
        </exec>

在执行脚本之前,如果我将权限设置为如下,我仍然会收到同样的错误。

<chmod file="/abc.sh" perm="777"/>

1 个答案:

答案 0 :(得分:0)

试试这个。希望它有所帮助

<chmod file="shell-script-location" perm="g+w" type="file"/>

您可以选择type =“file”或“dir”或“both”

相关问题